running non-python progs from python

Spiffy spiffy at worldnet.att.net
Wed Dec 10 01:27:06 CET 2003


"Diez B. Roggisch" <deets_noospaam at web.de> wrote in message
news:br5k2i$a6s$02$1 at news.t-online.com...
> >> > 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.
>
> Ok, most probably you'll start to yell at me now, but _there is a space
> missing_:
>
> >>> filename = "C:\Python22\Canyon.mid"
> >>> print "C:\Python22\playb.exe%s"%filename
> C:\Python22\playb.exeC:\Python22\Canyon.mid
>
> I have no WinBox here - but I bet even windows likes its commandline
> arguments somehow separated from each other. Try executing the line above,
> and I bet command.com complains about "Bad command or file name".
>
> Diez
>
>
...why would i yell at you? you are trying to help and i appreciate that.
Unfortunately, I have tried various spacings both in the filename and the
os.system call and what happens most often is that a dos box appears and
hangs and python stops responding.






More information about the Python-list mailing list