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> &lt;<a href="mailto:thomas.s.mark@gmail.com">
thomas.s.mark@gmail.com</a>&gt; 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 &lt;<a href="mailto:mhuster@simpsonuniversity.edu">
mhuster@simpsonuniversity.edu</a>&gt; wrote:<br>&gt; 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>&gt;&gt;&gt; userp = os.getenv('USERPROFILE') + '\\Desktop\\MyFile.txt'
<br>&gt;&gt;&gt; fo = file(userp, 'w')<br>--<br> _<br>( ) Mark Thomas&nbsp;&nbsp;&nbsp;&nbsp; ASCII ribbon campaign<br> X <a href="http://www.theswamp.org">www.theswamp.org</a>&nbsp;&nbsp; - against HTML email<br>/ \<br>_______________________________________________
<br>Tutor maillist&nbsp;&nbsp;-&nbsp;&nbsp;<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>&quot;A little nonsense now and then, is cherished by the wisest men.&quot;&nbsp;&nbsp;-- Roald Dahl<br>