On Saturday, July 16, 2005 at 2:46:34 PM UTC+2, Benji York wrote: > googlegro...@garringer.net wrote: > > How do I use Python to send keystrokes to a console window in Windows > > XP? > > import win32com.client > > shell = win32com.client.Dispatch("WScript.Shell") > shell.AppActivate("Command Prompt") > > shell.SendKeys("cls{ENTER}") > shell.SendKeys("dir{ENTER}") > shell.SendKeys("echo Hi There{ENTER}") > -- > Benji York
Hey! Do you have any idea on how to open 2 command panels at the same time and that every command would write to 1 command panel and other command to 2 command panel, when i tried to do something like this: shell.run("cmd") shell2.run("cmd") shell.AppActivate("cmd") time.sleep(5) shell.SendKeys('ffmpeg -y -f dshow -i video="Logitech HD Webcam C270" kamera'+datestring+'.mp4') shell2.SendKeys("xxxccccccccccccc{ENTER}") time.sleep(1) shell.SendKeys("{ENTER}") time.sleep(2) ffmpeg -y -f dshow -i ffmpeg -y -f dshow -i video="Logitech HD Webcam C270" kamera.mp4video="Logitech HD Webcam C270" kamera.mp4 shell.SendKeys('^c') time.sleep(2) shell.SendKeys('exit') time.sleep(1) shell.SendKeys("{ENTER}")''' everything gets in random places -- https://mail.python.org/mailman/listinfo/python-list