Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > popen2.Popen3 doesn't work well for me

Reply
Thread Tools

popen2.Popen3 doesn't work well for me

 
 
alexrait1
Guest
Posts: n/a
 
      03-09-2005
I launch my python. Then I write this:
import popen2
popen2.Popen3("mplayer *.mpg")

it starts playing for 2 seconds.. and then stops...
if I quit python (ctrl - D)
mplayer continues to run and plays music as it should...

Any ideas?

 
Reply With Quote
 
 
 
 
Steve Holden
Guest
Posts: n/a
 
      03-09-2005
alexrait1 wrote:
> I launch my python. Then I write this:
> import popen2
> popen2.Popen3("mplayer *.mpg")
>
> it starts playing for 2 seconds.. and then stops...
> if I quit python (ctrl - D)
> mplayer continues to run and plays music as it should...
>
> Any ideas?
>

It looks like the process you start is blocking on standard input or
output. Does

os.system("mplayer *.mpg")

do what you want?

regards
Steve

 
Reply With Quote
 
 
 
 
alexrait1
Guest
Posts: n/a
 
      03-09-2005
It does but that's not what I want. I need a class which I can query
for process termination for instance...
Is there a way to overcome this problem with Popen3?

 
Reply With Quote
 
Steven Bethard
Guest
Posts: n/a
 
      03-09-2005
alexrait1 wrote:
> It does but that's not what I want. I need a class which I can query
> for process termination for instance...
> Is there a way to overcome this problem with Popen3?


If you're using Python 2.4 you should look into the subprocess module.
I think these docs might be what you're looking for:

http://docs.python.org/lib/node235.html

STeVe
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help, the simplest code doesn't work well, but where is the problem? Quentin Huo ASP .Net 3 10-05-2004 05:40 PM
Hi Whats considered to be a well priced and well reviewed plasma tv 42 inch and above ? Hmmmmmmm DVD Video 8 09-28-2004 09:32 AM
Thunderbird and Firefox dno't work well togetehr loaery ouopwe4wiuyt Firefox 3 08-04-2004 02:57 AM
How to make other browsers work well with my asp.net app? Frank Rizzo ASP .Net 6 01-15-2004 05:12 AM
Can .NET & IExplorer well work together? zbuilder ASP .Net 3 09-16-2003 12:55 PM



Advertisments