[Tutor] (no subject)

Michael Huster mhuster at simpsonuniversity.edu
Wed Jul 6 17:21:49 CEST 2005


In python under windows, how can I create and access a file on the Desktop? The following do NOT work:
fp = open(r'Desktop\myFile','r')
fp = open(r'\Desktop\myFile','r')
fp = open(r'c:\Desktop\myFile','r')
fp = open(r'c:\Windows\Desktop\myFile','r')

I don't want to drill into c:\Documents and Setting\... because the user name is often obscure AND not all desktop files appear in the same subdir. of that. For example some are in 'All Users" or 'Default User'.

Michael Huster,
Simpson University


More information about the Tutor mailing list