Answers for "how to read from a line"

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

Code answers related to "how to read from a line"

Python Answers by Framework

Browse Popular Code Answers by Language