Answers for "file readline"

2

readline in a file

myfile = open("demo.txt", "r")
myline = myfile.readline()
while myline:
    print(myline)
    myline = myfile.readline()
myfile.close()
Posted by: Guest on June-24-2021

Python Answers by Framework

Browse Popular Code Answers by Language