How to start a new thread ?

Lad export at hope.cz
Sat Oct 23 10:42:08 EDT 2004


Sam Holden <sholden at flexal.cs.usyd.edu.au> wrote in message news:<slrncnkegj.7ft.sholden at flexal.cs.usyd.edu.au>...
> On 23 Oct 2004 02:27:13 -0700, Lad <export at hope.cz> wrote:
> > Tim Golden <tim.golden at viacom-outdoor.co.uk> wrote in message news:<mailman.5301.1098433895.5135.python-list at python.org>...
> >> 
> >> import os
> >> os.system ("/path/to/other/script.py")
> >> 
> > Dear Tim,
> > Thank you for the idea but it does not work without problems.
> > Your solution with os.system like 
> > os.system('start Script1.py')
> > os.system('start Script2.py')
> >
> > works( without problems) if I start the main script from console.
> > Os.system opens a new console window and starts a child script in each
> > console window.
> > But
> > if I start the main script from a browser, and that is what I want,
> > like http://myserver/cgi-bin/ParentScript.py
> > the ParentScript.py does not open a new WEB BROWSER window but starts
> > a new CONSOLE window.
> > But I would like to open  each child script in a WEB BROWSER window
> > not in console window. How can I do that?
> 
> It can't be done. The web browser decides when and how to open windows,
> your script can only send output to the browser and hope it does
> something vaguely like what you want. Some web browsers don't
> support multiple windows, for example.
> 
> You could send the browser some Javascript and on sufficiently insecure
> browsers that Javascript could make the browser open a new window
> and make a HTTP request which starts another script.

Sam, 
thanks for your reply.
If I can open console window
by os.system('start Script2.py')
isn't there any way how to send the output from that 
Script2.py to a browser? The reason is ( also) that the otput consists HTML code
Lad



More information about the Python-list mailing list