When you use the follow two lines, what you're saying is asking the interpreter to read 2 arguments:
from sys import argv
script, filename = argv
So when you save your code as test.py and you try to run the code below you get a ValueError, because it only $ python test.py only have one argument.
alvas@ubi:~$ python test.py
Traceback (most recent call last):
File "test.py", line 2, in <module>
script, filename = argv
ValueError: need more than 1 value to unpack
Let's say you have a textfile call in.txt and it only contains the text Hello World, and you try to call the script with the in.txt as second argument, it runs:
alvas@ubi:~$ echo "Hello World" > in.txt
alvas@ubi:~$ python test.py in.txt
Here's your file 'in.txt':
Hello World
Type the filename again:
>
Note: The first line is just a fancy way to create in.txt file with text Hello World
See http://www.tutorialspoint.com/python/python_command_line_arguments.htm for a nice tutorial on using argv =)