Python Forum
[PyWinAuto] Please help me with Typekeys ()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyWinAuto] Please help me with Typekeys ()
#1
Hello everyone,
I have some code as below:
from pywinauto import application
from pywinauto import keyboard
app = application.Application()
app.connect(path= r"C:\Windows\system32\cmd.exe")
dlg = app.top_window_()
dlg.TypeKeys('cd /d C:\Program Files (x86)\',with_spaces = True)
keyboard.send_keys('{ENTER}')
dlg.TypeKeys('abc.exe')
keyboard.send_keys('{ENTER}')
Could you help me to show the (x86). Because it cannot show () so it notify error
Error:
The system cannot find the path specified.
Please help me!
Thanks all
Reply
#2
backslash \ is a special character in strings use double backslash \\ to get a normal \
dlg.TypeKeys('cd /d C:\\Program Files (x86)\\',with_spaces = True)
Reply
#3
(Apr-22-2019, 09:39 AM)Yoriz Wrote: backslash \ is a special character in strings use double backslash \\ to get a normal \
dlg.TypeKeys('cd /d C:\\Program Files (x86)\\',with_spaces = True)

Thank you very much :)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  MemoryError in pywinauto.findwindows.find_windows – Need Help! ktw3857 1 315 Apr-18-2024, 04:28 PM
Last Post: itegumo
  Pywinauto typing in the wrong field EGameiro 0 682 Jun-07-2023, 10:01 PM
Last Post: EGameiro
  Help ~ coding with pywinauto NickNHartley 1 2,346 Apr-20-2023, 05:20 PM
Last Post: farshid
  pywinauto, anyone use it? thewolf 1 2,849 Mar-01-2021, 09:58 PM
Last Post: snippsat
  set_focus() in python pywinauto stearno 0 4,771 Nov-05-2020, 09:34 AM
Last Post: stearno
  Kindly asking for help with Pywinauto louloulou 0 2,028 Mar-05-2020, 06:55 PM
Last Post: louloulou
  Checking the presence of label using pywinauto module Malt 0 1,928 Jul-26-2019, 09:06 AM
Last Post: Malt
  Not able to convert PYWINAUTO module automation in exe file Utkarsh29 0 2,450 Mar-19-2019, 09:39 PM
Last Post: Utkarsh29
  pywinauto problems vnc 3 8,169 Apr-13-2017, 11:21 AM
Last Post: vnc
  pywinauto timings timout error stonetr33 4 11,485 Dec-07-2016, 12:55 AM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020