Python Forum
Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pywinauto problems
#1
Apologies if this is the wrong location for the post, i wasn't sure where it fits...anyways:

I already had python 3.6 installed on windows 10 and have just also installed pywinauto
to do this i just ran >pip install pywinauto  via the command line

I have been experimenting with very basic code straight into cmd and via the python shell which works fine.
However if i create a py file via IDLE i just get an import error for 'application' see below:
 
Error:
Traceback (most recent call last):   File "C:\Users\<myuser>\Desktop\pywinauto.py", line 1, in <module>     from pywinauto import application   File "C:\Users\<myuser>\Desktop\pywinauto.py", line 1, in <module>     from pywinauto import application ImportError: cannot import name 'application'
i'm sure this is something to do with the env variables or the relevant path etc ..but i'm not proficient enough to solve the problem.

the code i've started with is:
from pywinauto import application

import time

def main():
   app = application.Application()
   app.start("Notepad.exe")
   time.sleep(3)
   app.notepad.edit.TypeKeys("Hello World")
   time.sleep(2)
   app.Notepad.menuSelect("File ->SaveAs")
   app.SveAs.edit.SetText("pywinautodemo.txt")
   app.SaveAs.Save.Click()

main()
Any help greatly appreciated!

ta
   VNC
Reply


Messages In This Thread
pywinauto problems - by vnc - Apr-13-2017, 10:32 AM
RE: pywinauto problems - by SpeedyZapGaming - Apr-13-2017, 10:45 AM
RE: pywinauto problems - by wavic - Apr-13-2017, 11:03 AM
RE: pywinauto problems - by vnc - Apr-13-2017, 11:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  MemoryError in pywinauto.findwindows.find_windows – Need Help! ktw3857 1 356 Apr-18-2024, 04:28 PM
Last Post: itegumo
  Pywinauto typing in the wrong field EGameiro 0 711 Jun-07-2023, 10:01 PM
Last Post: EGameiro
  Help ~ coding with pywinauto NickNHartley 1 2,400 Apr-20-2023, 05:20 PM
Last Post: farshid
  pywinauto, anyone use it? thewolf 1 2,870 Mar-01-2021, 09:58 PM
Last Post: snippsat
  set_focus() in python pywinauto stearno 0 4,814 Nov-05-2020, 09:34 AM
Last Post: stearno
  Kindly asking for help with Pywinauto louloulou 0 2,048 Mar-05-2020, 06:55 PM
Last Post: louloulou
  Checking the presence of label using pywinauto module Malt 0 1,954 Jul-26-2019, 09:06 AM
Last Post: Malt
  [PyWinAuto] Please help me with Typekeys () mattroi261192 2 7,944 Apr-23-2019, 01:55 AM
Last Post: mattroi261192
  Not able to convert PYWINAUTO module automation in exe file Utkarsh29 0 2,473 Mar-19-2019, 09:39 PM
Last Post: Utkarsh29
  pywinauto timings timout error stonetr33 4 11,556 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