IT
Applied Programming – Python
Part V
Lecture 6
Dr. Nwe Nwe Htay Win
M. C. Sc, University of Computer Studies, Mandalay
Ph.D (IT), China
Harbin Institute of Technology
IT
Outlines
• File I/O
• GUI Login Check Application
IT
File I/O in Python
• # Python program to illustrate file1 = open("[Link]","r")
print("Output of Readlines after appending")
• # Append vs write mode print([Link]())
• file1 = open("[Link]","w") print()
• L = ["This is Delhi \n","This is Paris \n","This is [Link]()
London \n"]
• [Link](L) # Write‐Overwrites
• [Link]() file1 = open("[Link]","w")#write mode
[Link]("Tomorrow \n")
• [Link]()
• # Append-adds at last
• file1 = open("[Link]","a")#append mode file1 = open("[Link]","r")
• [Link]("Today \n") print("Output of Readlines after writing")
print([Link]())
• [Link]()
print()
• [Link]()
IT
Reading Login info file
• with open('[Link]') as f:
• lines = [Link]()
• for x in lines:
• data=[Link](',')
• for v in data:
• print(v)
• print()
IT
• Let’s Code Login Check Example With GUI
IT
Next Lecture
• Software Engineering - I
IT
References
• [Link]
• [Link]
qmainwindow/
• [Link]