from sys import argv # import argv

script, input_file = argv # define argv

def print_all(f): # define a function
    print(f.read()) # print all

def rewind(f): # define a function
    f.seek(0) # jump the starting point of a file

def print_a_line(line_count, f): # define a function
    print(line_count, f.readline()) # pinrt a line on the file

current_file = open(input_file) # open a file

print("First let's print the whole file:\n") # print a script

print_all(current_file) # call the function

print("Now let's rewind, kind of like a tape.") # print a script

rewind(current_file) # call the function

print("Let's print three lines:") # print a script

current_line = 1 # define a value
print_a_line(current_line, current_file) # call the function

#current_line = current_line + 1 # define a value
current_line += 1
print_a_line(current_line, current_file) # call the function

#current_line = current_line + 1 # define a value
current_line += 1
print_a_line(current_line, current_file) # call the function
