[Tutor] Acessing files in Windows 2000

Dave S pythontut at pusspaws.net
Thu Mar 10 00:17:51 CET 2005


jfouhy at paradise.net.nz wrote:

>>>>>>import os.path
>>>>>>print os.path.expanduser('~/memo.txt')
>>>>>>            
>>>>>>
>>>C:\Documents and Settings\Administrator/memo.txt
>>>      
>>>
>>>>>>f = open(os.path.expanduser('~/memo.txt'))
>>>>>>            
>>>>>>
>>>Traceback (most recent call last):
>>>File "<pyshell#15>", line 1, in ?
>>>f = open(os.path.expanduser('~/memo.txt'))
>>>IOError: [Errno 2] No such file or directory: 'C:\\Documents and
>>>Settings\\Administrator/memo.txt'
>>>      
>>>
>>>Now starting to doubt my sanity I again re-checked C:\Documents and
>>>Settings\Administrator\My Documents
>>>and yes I do have a memo.txt there.
>>>      
>>>
>
>Um ---
>
>So you have a file 'C:\Documents and Settings\Administrator\My
>Documents\memo.txt'...
>
>But you are attempting to open the file 'C:\Documents and
>Settings\Administrator\memo.txt'.
>
>There is a difference there!
>
>  
>
mmm ... I kind of see what you mean.

Does anyone have like a realy large shovel so I can dig a hole and hide ?

Thanks

Dave



More information about the Tutor mailing list