Apr-13-2017, 10:32 AM
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:
the code i've started with is:
ta
VNC
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