os.system()

Adam Skutt askutt at gmail.com
Fri Apr 20 14:10:24 EDT 2012


On Apr 20, 6:51 am, Yigit Turgut <y.tur... at gmail.com> wrote:
> On Apr 19, 11:02 pm, "Steve" <n... at spam.com> wrote:
>
> > > "Yigit Turgut"  wrote in message
> > >news:b9a8bb28-3003-4a36-86fb-339ef697b52f at i2g2000vbd.googlegroups.com...
> > > When I use os.system() function, script waits for termination of the
>
> > windows that is opened by os.system() to continue thus throwing errors
> > and etc. How can i tell Python to let it go and keep on with the next
> > execution after os.system() ?
>
> > Can you make use of subprocess.Popen() ?
>
> Still waits for the new windows to kill.

It should not do so unless you tell it do so, but without more details
it's difficult to determine what is happening.  The only waiting that
should be necessary is to eventually call Popen.poll() or Popen.wait()
to reap the subprocess after it terminates, but there are many correct
ways to do that depending on your application and the subprocess.  A
thread, as suggested by Jacob, is one way to accomplish it.

Adam



More information about the Python-list mailing list