On 26/07/2019 06.33, nir.za...@gmail.com wrote:
> Hi,
>
> I want it to wait for a specific text on the terminal window that it opens 
> (putty.exe), how can i do it? 
>
> from pywinauto.application import Application
> from pynput.keyboard import Key, Controller
>  
> print('Configuring')
>  
> app = Application().start(cmd_line=u'"C:\\...putty.exe" ')
> puttyconfigbox = app.PuTTYConfigBox
> puttyconfigbox.wait('ready')
> listbox = puttyconfigbox.ListBox
> listbox.select(u'COM5')
> button = puttyconfigbox[u'&Load']
> button.click()
> button2 = puttyconfigbox[u'&Open']
> button2.click()
>  
> keyboard = Controller()
> keyboard.press(Key.enter)
>  
> keyboard.type('password1')
> keyboard.press(Key.enter)
> keyboard.type('enable\nconf t\n')
>
Not a clue, but why are you using PuTTY at all? Can't whatever it is
you're doing be achieved much more simply using e.g. pyserial, accessing
the COM port directly from Python?

-- T


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to