[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: How do I send keystrokes to a console window in Windows XP?
From:       jglobocnik37 () gmail ! com
Date:       2017-11-28 8:14:17
Message-ID: dac99e03-3756-4459-acb2-ba26f89dc383 () googlegroups ! com
[Download RAW message or body]

On Saturday, July 16, 2005 at 2:46:34 PM UTC+2, Benji York wrote:
> GoogleGroups@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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic