0

我的 Python 脚本创建了一个 HTML 文件,该文件又调用了 Google Charts。我想在最后添加一个系统调用来启动这个 HTML 文件以通过网络浏览器显示结果。

我尝试使用子进程和系统调用函数,但结果相同:WindowsError: [Error 193] %1 is not a valid Win32 application where %1 is the name of the output file from my script with .HTML extension .

只需键入文件名,我就可以从 DOS shell 启动相同的文件。

通过 Python 脚本完成此任务的正确方法是什么?

4

1 回答 1

1

使用webbrowser.open('my_file.html').

于 2013-08-13T12:44:20.980 回答