Python Question

Getting user input

I am running this:

import csv
import sys
reader = csv.reader(open(sys.argv[0], "rb"))
for row in reader:
print row

And I get this in response:

['import csv']
['import sys']
['reader = csv.reader(open(sys.argv[0]', ' "rb"))']
['for row in reader:']
[' print row']

For the
I would like it to prompt me to enter a filename.

How do I get it to prompt me to enter a filename?

Answer Source

In python 3.x, use input() instead of raw_input()