メモ帳でjsonファイルとhtmlファイルを開こうとしています。次のコードがあります。
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")
問題は、現時点では、コマンド プロンプト ウィンドウが約 1 秒間点滅してから消えることだけです。ファイルの内容をメモ帳に表示する必要があります。
Windowsでpython 3.3を使用する
前もって感謝します