Problem with os.system()

Emile van Sebille emile at
Fri Sep 28 16:45:05 CEST 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"'
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


Emile van Sebille
emile at

"Janos Blazi" <jblazi at> wrote in message
news:3bb480af_1 at
> 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
> 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  =-----
> - 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