[Tutor] XP & catching execl o/p ?

Dave S pythontut at pusspaws.net
Wed Dec 6 08:12:57 CET 2006


On Tuesday 05 December 2006 23:32, Alan Gauld wrote:
> "Dave S" <pythontut at pusspaws.net> wrote
>
> > Struggling with python & XP again. My app needs to know if a certain
> > program
> > is running on my XP box
> >
> > os.execl('....')
> > It throws the output to the terminal + I need the exact path to the
> > executable
> > (a bit of a trial)
> >
> > Any ideas how I can catch the output ?
>
> Look at the popen family of functions in the os module, and then
> look at the subporocess module which supercedees them
> (but the docs are expressed in tems of the oold functions!)
>
> Use subprocess because the older popen functions don't always
> work reliably on Windows - there is a separate popen as part of
> the winall package, but I think subprocess.Popen works Ok.
>
> There is more on this, including a simple example using subprocess,
> in my OS topic in my tutorial.
>
> HTH,

Thanks for your help - I will take a look. :)

Dave



More information about the Tutor mailing list