running non-python progs from python

Fedor fedor at mailandnews.com
Tue Dec 9 18:51:52 EST 2003


"Spiffy" <spiffy at worldnet.att.net> wrote in message
news:2fsBb.423999$0v4.20388116 at bgtnsc04-news.ops.worldnet.att.net...
>
> "Diez B. Roggisch" <deets_noospaam at web.de> wrote in message
> news:br5hu8$em2$01$1 at news.t-online.com...
> > > Here is the code used to call it from Python:
> > > import os
> > > filename = "C:\Python22\Canyon.mid"
> > > os.system("C:\Python22\playb.exe%s"%filename)
> > > ...this causes a dos box to appear which promptly hangs and does
> nothing,
> > > at which time Python stops responding. Vartiations on this will cause
> the
> > > dos box to appear with the message "Bad command or file name".
> > >
> >
> > Looks like there is a space missing -
> >
> > os.system("C:\Python22\playb.exe %s"%filename)
> >                                 ^
> >
> > Diez
> >
>      There is no space missing. That is the name of the file on my comp.
>
>

The ^ points right after exe. (use fixed fonts to see). The command you are
executing is:

C:\Python22\playb.exeC:\Python22\Canyon.mid

There needs to be a space between exe and the second C:

Hope it helps.






More information about the Python-list mailing list