<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> On Jun 12, 8:42 am, "T. Crane" <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> How is the default path chosen in this instance:
>>
>> myFile = file('test.txt','w')
>>
>> Here I'm opening/creating a file but I have not specified the exact path, 
>> so
>> how does Python determine where to 'put' this file?  More to the point, 
>> how
>> do I change what the default path is?  Right now it's a networked drive 
>> that
>> should not be getting my Python clutter.
>>
>> Interestingly, this network drive is also where I can find my _ipython
>> folder from my ipython install as well as my .matplotlib folder.  Can 
>> anyone
>> tell me how to change where these folders and files go by default?
>>
>> thanks for any help,
>> trevis
>
> When you don't specify where you want to save a file, it saves the
> file to the directory the script itself is run from. As far as I know,
> you have to specify where you want the file saved if you don't want it
> with the script.py

Unfortunately, this is not the case.  My module's path is this:

C:\documents and setting\t_crane\my documents\python modules\script.py

Python is in the directory C:\Python25

The file is being saved in this path:

K:\myFile.txt  (this is the networked drive mentioned above)

As an aside, I forgot to mention above that I'm using Windows XP.  Any other 
ideas or possible reasons that it would not choose my script location as the 
default location to save something?

thanks,
trevis 


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to