Sending a command to a program using os.system (was [Tutor]: Using os.popen*() and os.spawn*() to interact with a DOS box)

Orri Ganel singingxduck at gmail.com
Sun Jan 16 07:22:29 CET 2005


Orri Ganel wrote:

> I did some googling, and found this in the archives of this mailing list:
>
> import os
> os.system('c:\\abaqus\\5.8-14\\abaqus.exe post')
>
> , where post was a command, *not* a file.  Now, I tried something 
> similar, since essentially what I wish to be able to do is have 
> Audacity think I typed the 'R' key:
>
> os.system(r'c:\progra~1\audacity/audacity.exe R')
>
> All this managed to accomplish was Audacity opening (good) and a 
> message from Audacity (not good):
>
>
>
> ("Could not open file: R" since i had to make it small to fit in the 
> email message comfortably)
>
> Any ideas on a) why this didn't work and b) what to do to make 
> something similar work are greatly appreciated.
>
> Thanks in advance,
> Orri
>
>-- 
>Email: singingxduck AT gmail DOT com
>AIM: singingxduck
>Programming Python for the fun of it.
>
Well, now at least I know why that didn't work, if not what to do about it:

http://cvs.sourceforge.net/viewcvs.py/audacity/audacity-src/help/audacity.1?rev=1.5

"The only command-line arguments Audacity takes are the names of audio 
files to open."
-- 

Email: singingxduck AT gmail DOT com
AIM: singingxduck
Programming Python for the fun of it.

-------------- next part --------------
Skipped content of type multipart/related


More information about the Tutor mailing list