RosettaCodeData/Task/Input-loop/Python/input-loop-4.py

3 lines
141 B
Python

line = my_file.readline() # returns a line from the file
lines = my_file.readlines() # returns a list of the rest of the lines from the file