running non-python progs from python

Kristofer Wouk kristofer at hotpop.com
Thu Dec 11 09:39:36 EST 2003


Spiffy wrote:
> "Marc Boeren" <M.Boeren at guidance.nl> wrote in message
> news:mailman.30.1071062337.9307.python-list at python.org...
> 
>>Hi,
>>
>>
>>>Spiffy wrote:
>>>
>>>>>that indicates that it's supposed to work, don't you think?
>>>>
>>>>IT COULD HAVE BEEN A MISPRINT, DON'T YOU THINK?
>>
>>I can understand that you get frustrated that os.system doesn't seem to
>>work, but there's no need to shout.
>>
> 
> 
> Shout? That's funny, I like that. If I appear to have been angry, it was
> directed solely at one person, who for some unknown reason, was more
> interested in harassing than helping me.
> 
> 
>>I've read the thread, and noticed one odd thing. You said that if you
>>execute:
>>
>>C:\Python22>playb Canyon.mid
>>
>>from the command line, it works.
>>Later, you try to execute 'C:\Python22\playb.exe' with Canyon.mid as a
>>parameter.
>>
>>Did it occur to you that playb.exe may not be located in C:\Python22\ at
>>all?
> 
> 
> ....playb.exe is located in C:\Python22\
> 
> 
>>The command-line you said you executed starts playb from within the
> 
> Python22
> 
>>folder, but it could have found playb.exe anywhere in your Windows PATH.
>>
>>Can you locate playb.exe on you hard-drive using the Windows Explorer?
> 
> What
> 
>>is the exact location the program appears in? Try to use that in you call
> 
> to
> 
>>os.system.
>>
>>One other useful technique to track down a problem:
>>
>>import os
>>program = r"C:\Windows\playb.exe"
>>filename = r"D:\MIDI\anyfile.mid"
>>commandline = "%s %s" % (program, filename)
>>print commandline
>>os.system(commandline)
>>
>>This will print the complete command-line first. You can copy/paste this
> 
> to
> 
>>a DOS-box and execute it (from within any directory) and see what happens.
>>
>>Good luck,
>>
>>Cheerio, Marc.
>>
> 
> 
> Thanks for responding and trying to help. Fredo emailed me with a solution
> for the problem and now I have working code. yay!
> 
> 
I'd just like to add here, I really don't think you were being 
"harrassed" at all. I can understand getting frustrated when you
can't get anything working, but from my experience with c.l.p, I
don't think I've ever seen anyone harrased by someone who actually
frequents the list.

Kris





More information about the Python-list mailing list