0

I've done this 100 times, but for some reason this is breaking...can anyone tell what I'm doing wrong?

Screen shot of the directory - http://cl.ly/image/2K1P1J0m1X2B

Code:

csv_file = open('10_13_outbounds.csv','rU')
csv_reader = csv.reader(csv_file)
return csv_reader

Getting this error:

IOError: 2, 'No such file or directory'
10
  • Well, you're trying to open a file that does not exist! Maybe you mistyped the name, are in a different directory or someone has (re)moved it earlier? Commented Oct 13, 2014 at 21:35
  • 1
    How are you running your Python script? Commented Oct 13, 2014 at 21:36
  • @hochl Thats what I don't get. Bot the .csv file AND the python script are in the same directory. Commented Oct 13, 2014 at 21:38
  • 1
    Actually I suspect '10_13_outbounds.csv.csv' would work. It looks like you have extension of known types hidden (the default) in Windows Explorer (Folder Options) Commented Oct 13, 2014 at 21:38
  • 2
    It doesn't matter what directory the Python script is in, it matters what directory is the current working directory. There's no guarantee they're the same thing. Commented Oct 13, 2014 at 21:40

1 Answer 1

2

Actually, based on the screenshot: enter image description here

It appears that '10_13_outbounds.csv.csv' would work. It looks like you have extension of known types hidden (the default) in Windows Explorer (Folder Options)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.