Alan Gauld wrote:
I'm trying to use Python to start the dos-box ("cmd.exe") and beable tocall commands on it and receive output from it.The Command window is just a terminal, there is no output to be had other than an exit code when it closes.However, none of the documentation for popen and spawn cover this . . .Nope, there is nothing to be received from the terminal, you might as well open Notepad and try to read output from it (in fact that would probably work better!). What is it you are trying to do using the DOS box? Its probably easier to run the commands that you would run inside the box from Python. But if you are trying to monitor what *a user* is doing then it gets more tricky. Alan G. Well, ultimately, what I want to be able to do is open Audacity (http://audacity.sourceforge.net/) at a predetermined time and have it begin recording wave mix out (the default i have it set to anyway), and then have it stop again when i send it a command. This is basically to automate recording once a song begins playing in a certain media player, and stop recording when it's over. I don't know if it would be easier to do any or all of it in Python than in the DOS box, but since I have trouble with sending commands to the DOS box, I imagine sending commands to Audacity will be even more troublesome. Right now I have little to no idea where to go from here. I have the idea of what I want to do, but no knowledge on how to do it. Once again, any help would be appreciated. Thanks in advance, Orri -- Email: singingxduck AT gmail DOT com AIM: singingxduck Programming Python for the fun of it. |
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor