|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
IOError?
Hi, I am receiving an IOError (2) when I try to open() or file(). I have reinstalled Python but cannot remedy this issue. Python says it can't find the file even though the file I am trying to open is in the script's working directory. Thanks.
Ryan |
|
#2
|
||||
|
||||
|
Scripts working directory? As far as i know Python doesn't have a directory called this so, this will mean nothing to Python, try typing the full path to the file and see if that helps. You may also want to check your current working directory using os.getcwd()
Mark. |
|
#3
|
|||
|
|||
|
Right, by 'working directory' I meant the CWD....which shows as the directory where both the script and file reside...
|
|
#4
|
||||
|
||||
|
Sorry i totaly misunderstood you there
. Anyway, maybe you could post some code. Also, what playform and version of Python are you using.Mark. |
|
#5
|
|||
|
|||
|
Well....anything with the file or open function just fails...
x = file('something.txt', 'r') y = open('blah.dat', 'r') ...both give IOError [2] |
|
#6
|
||||
|
||||
|
Ok, but what OS and Python version are you running. Also, did you try using the full path to the file?
|
|
#7
|
|||
|
|||
|
Nevermind...the 'problem' (as it wasn't) was solved. Thank you and sorry for the time.
|
|
#8
|
|||
|
|||
|
What was the non-problem?
|
|
#9
|
||||
|
||||
|
Really, that was what i was wondering
. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > IOError? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|