[Tutor] Loading and writing files

Daniel Yoo dyoo@hkn.EECS.Berkeley.EDU
Mon, 31 Jul 2000 13:27:52 -0700 (PDT)


> import string 
> import sys
> 
> print "Enter the name of the .CSV file to convert:"
> in_file = raw_input(".CSV file name?  ")
> in_file = open(x,"r")
                 ^
                 |

A little bit of ASCII art... *grin* 'x' is a typo --- you want to grab the
filename stored by 'in_file' instead.

The conceptual problem is between file names and file objects.  They're
different, so perhaps it'll make it easier to give them different variable
names:

  in_filename = raw_input(".CSV file name?  ")
  in_file = open(in_filename,"r")


Next time through, it would be helpful to pinpoint to us your problem or
bug; otherwise, it makes it much harder to find a solution.