This will work, but only on an English version of the OS. E.g. in Dutch the desktop is called 'Bureaublad'.

On 7/6/05, Mark Thomas < [EMAIL PROTECTED]> wrote:
On 7/6/05, Michael Huster < [EMAIL PROTECTED]> wrote:
> In python under windows, how can I create and access a file on the Desktop? The following do NOT work:

How about...

>>> userp = os.getenv('USERPROFILE') + '\\Desktop\\MyFile.txt'
>>> fo = file(userp, 'w')
--
_
( ) Mark Thomas     ASCII ribbon campaign
X www.theswamp.org   - against HTML email
/ \
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor



--
"A little nonsense now and then, is cherished by the wisest men."  -- Roald Dahl
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to