poblem regarding opening a html file

Aaron Brady castironpi at gmail.com
Mon Dec 29 15:01:58 CET 2008


On Dec 29, 6:10 am, "Hendrik van Rooyen" <m... at microcorp.co.za> wrote:
> Sibtey Mehdi  wrote:
> >Hi
> >            I have a GUI application (wxpython) that calls another GUI
>
> Application. I m using os.system (cmd) >to launch>The second GUI, in the second GUI I m trying to open the html file using the
>
> os.startfile (filename) function >but
>
> >It takes lots of time to open the html file.
> >If I am running only the second application then ‘os.startfile’ quickly open
> the html file.
> >Any one can help me to solve this problem.
>
> Buy more memory?
>
> - Hendrik

You might be running into problems with duelling message pumps in the
GUI loops.  The 'os.system' call runs in a subprocess, not in an
independent one.

If you use 'subprocess.Popen', you can explicitly wait on the second
process, which will hang your first GUI, but may cause the second one
to run better.  Or, you have the option to not wait for it.

I see that 'os.system' waits for the second process to complete, while
'startfile' does not.

Just a thought, are you looking for the 'webbrowser' module?


Another option is to run it from a separate thread.



More information about the Python-list mailing list