Quoting Dave S <[EMAIL PROTECTED]>:

> I need to access 'memo.txt' in 'my documents' on windows & am
> struggling.
> I have tried just about every combination of \ and / and \\ and // but 
> to no avail.
> I need something like ...
> 
> C:\My Documents\memo.txt
> 
> Can anyone advise me ?

I've never had any trouble accessing files in Win2k with python.  

The following would all work for me:

f1 = file('c:\\My Docments\\memo.txt')
f2 = file('c:/My Documents/memo.txt')
f3 = file(os.path.normpath('c:/My Documents/memo.txt'))  # os.path.normpath
normalizes a path; it also converts / to \\ on Windows platforms

Is your path correct?  The "My Documents" folder doesn't normally live in the
root in Win2k; it is more likely to be found somewhere like C:\Documents and
Settings\Username\My Documents.  Or, in an office environment, it might be on a
network share --- eg, H:\.

HTH.

-- 
John.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to