Python: How to open json and html files in notepad?
<p>Im trying to open json and html files in notepad. I have the following code:</p>

<pre><code>def openFile():
    fileName = listbox_1.get(ACTIVE)
    if fileName.endswith("json") or fileName.endswith("htm"):
        os.system("notepad.exe" + fileName)
    elif fileName.endswith("jpeg"):
        os.startfile(fileName)
    else:
        messagebox.showerror(title="Error", message="File is not relevant, please choose one with a directory")
</code></pre>

<p>The problem is at the moment all that happens is that a command prompt window flashes up for about a second then disappears. I need for the content of the file to be displayed in notepad.</p>

<p>Using python 3.3 on windows</p>

<p>Thanks in advance</p>
