Python 3 PyWinAuto Script to Automate Notepad GUI to Open Create and Save Files and Close Automatically Full Project For Beginners

 

 

First of all you need to install the library using the pip command as shown below

 

 

pip install pywinauto

 

 

After this you need to make an app.py file and copy paste the following code

 

 

app.py

 

 

from pywinauto.application import Application
app = Application().start("notepad.exe")
app.UntitledNotepad.Edit.type_keys("This is Kushan Amarasiri - Python Rocks...", with_spaces = True)
app.UntitledNotepad.menu_select("File->Save As")
dlg = app.window(title='Save As')
dlg.Edit.type_keys("kushan")
dlg.Save.click()
dlg.Save.click()
app.UntitledNotepad.menu_select("File->Exit")

Leave a Reply