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

Alan Gauld alan.gauld at freenet.co.uk
Sun Jan 16 09:45:14 CET 2005


> 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):

os.system() simply executes a command like you would in a dOS
box. No magic. Thus is Audacity can do what you want from typing
manual commands att a DOS ptrompt then you can use os.system()
to replicate that. But if you can't do it from DOS then you
can't use os.system() either.

You need to look at the Audacity help files to see what options
are available both from the command line and as an API to
interact with Audacity. Until you know that you can't begin
to know how to solve the problem in PYthon.

Does Audacity have a mailing list? Why not try asking there
what options are available?

Alan G.



More information about the Tutor mailing list