Ken Erickson
Ken Erickson

Reputation: 31

I would start my web browser by executing a .html file

My Python script creates an HTML file which in turns calls Google Charts. I would like to add a system call at the end to launch this HTML file to display the results via a web brower.

I've tried using the subprocess and system call functions but both have the same result: 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.

I'm able to launch the same file from a DOS shell just by typing the file name.

What would be the correct way to accomplish this task via a Python script?

Upvotes: 0

Views: 53

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599630

Use webbrowser.open('my_file.html').

Upvotes: 1

Related Questions