CodeDev01
New Coder
How to open files in Python. The 'for line in file.readlines(): print(line)' prints a line inbetween each line of the opened document, which makes it look better
Python:
file = open("text.txt", "r")
for line in file.readlines():
print(line)
file.close()
Attachments
Last edited: