Problem with os.system()

Emile van Sebille emile at fenx.com
Fri Sep 28 10:45:05 EDT 2001


The following should work, and does on win98 python 1.5.2, but on win2k
w/python 2.1 I get an error.

import os

prog=r'"F:\Program Files\Windows Media Player\mplayer2.exe"'
f=r'f:\pca10\swoosh.WAV'
os.spawnv(os.P_NOWAIT, prog, (prog, ' /Play ' ,f))

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
OSError: [Errno 22] Invalid argument

This is probably what you want, I just don't know why it doesn't work on
win2k.

--

Emile van Sebille
emile at fenx.com

---------
"Janos Blazi" <jblazi at hotmail.com> wrote in message
news:3bb480af_1 at news.newsgroups.com...
> I have the following code:
>
>     prog=r'"C:\Programme\Windows Media Player\mplayer2"'
>     f=r'c:\WINNT\Media\Microsoft Office 2000\APPLAUSE.WAV'
>     os.system(prog+' /Play '+f)
>
> Now first it seems as though it worked and the wav file is played. The
> problem is that after the wav file has ben played my program does not
regain
> the control i.e. the next statement is not executed. If I close the Media
> Player window manually, my program resumes. I use Win2000 but my program
> should work under MS-DOS.
>
> Can anybody help me?
>
> J.B.
>
>
>
>
> -----=  Posted via Newsfeeds.Com, Uncensored Usenet News  =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
>  Check out our new Unlimited Server. No Download or Time Limits!
> -----==  Over 80,000 Newsgroups - 19 Different Servers!  ==-----




More information about the Python-list mailing list