learn python the hard way exercise 20 help
<p>for the extras of exercise 20 i was told to comment what i think each line does. seek i found confusing. if anyone is willing to check out my comments on the source to see if i understand correctly. i could skip it but i feel its important i understand this.</p>

<p>thanks</p>

<pre><code>from sys import argv #imports argv from sys moduel 

script, input_file = argv #unpacks the startup arguments to script and input_file variables

def print_all(f): #defines a function that uses the read() function on whatever is in the parameter(current_file in this case)
    print f.read()

def rewind(f): #not a clue what this does really...moves to byte 0 of the file??
    f.seek(0)

def print_a_line(line_count, f): #sets a function that reads a line from the current_file
    print line_count, f.readline()

current_file = open(input_file)

print 'first of all, lets read the wole file:\n'

print_all(current_file)

print 'now lets rewind, kind of like a tape'
rewind(current_file)

print 'lets print 3 lines:'

current_line = 1
print_a_line(current_line, current_file)

current_line = current_line + 1
print_a_line(current_line, current_file)

current_line = current_line + 1
print_a_line(current_line, current_file)
</code></pre>
