This will work, but only on an English version of the OS. E.g. in Dutch the desktop is called 'Bureaublad'.<br><br><div><span class="gmail_quote">On 7/6/05, <b class="gmail_sendername">Mark Thomas</b> <<a href="mailto:thomas.s.mark@gmail.com">
thomas.s.mark@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 7/6/05, Michael Huster <<a href="mailto:mhuster@simpsonuniversity.edu">
mhuster@simpsonuniversity.edu</a>> wrote:<br>> In python under windows, how can I create and access a file on the Desktop? The following do NOT work:<br><br>How about...<br><br>>>> userp = os.getenv('USERPROFILE') + '\\Desktop\\MyFile.txt'
<br>>>> fo = file(userp, 'w')<br>--<br> _<br>( ) Mark Thomas ASCII ribbon campaign<br> X <a href="http://www.theswamp.org">www.theswamp.org</a> - against HTML email<br>/ \<br>_______________________________________________
<br>Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br></blockquote></div><br><br><br>
-- <br>"A little nonsense now and then, is cherished by the wisest men." -- Roald Dahl<br>