On 4/15/2012 5:13 AM, contro opinion wrote:
>>> f=open(r'c:\windows\temp\test','r')
>>> f=open('c:\\windows\\temp\\test','r')
Your life will be much happier is you use forward slashes for filenames
in Python programs.
f = open('c:/windows/temp/test', 'r')
You only need backslashes when
for more information.
> 1.
>>>> f=open(r'c:\windows\temp\test','r')
> Traceback (most recent call last):
> File "", line 1, in
> IOError: [Errno 2] No such file or directory: 'c:\\windows\\temp\\test'
>
> would you mind tell
> IOError: [Errno 2] No such file or directory: 'c:\\windows\\temp\\test.txt'
> would you mind telling me what's wrong ?
>
I think the file that you try to open does not exists :)
Please be more specific. What are you trying to achieve, and are you
absolutely sure that such a file exist?
Almar
#x27;)
Traceback (most recent call last):
File "", line 1, in
IOError: [Errno 2] No such file or directory: 'c:\\windows\\temp\\test'
2.
>>> f=open(r'c:\windows\temp\test.txt','r')
Traceback (most recent call last):
File "", line 1, in