0

私の Python スクリプトは、Google Charts を呼び出す HTML ファイルを作成します。最後にシステム コールを追加して、この HTML ファイルを起動し、Web ブラウザで結果を表示したいと考えています。

サブプロセスとシステム コール関数を使用してみましたが、どちらも同じ結果になりました: WindowsError: [Error 193] %1 is not a valid Win32 application where %1 is the name of the output file from my script with the .HTML extension .

ファイル名を入力するだけで、DOS シェルから同じファイルを起動できます。

Python スクリプトを使用してこのタスクを達成する正しい方法は何でしょうか?

4

1 に答える 1

1

を使用しwebbrowser.open('my_file.html')ます。

于 2013-08-13T12:44:20.980 に答える