Python console's workspace path

MRAB python at mrabarnett.plus.com
Tue Sep 5 11:44:00 EDT 2017


On 2017-09-05 15:31, Stefan Ram wrote:
> Andrej Viktorovich <viktorovichandrej at gmail.com> writes:
>>Hello,
>>I run Python 3.6 console under windows 10. Where is default console directory?
>>I run script:
>>>>> tf = open ("aaa.txt", "w")
>>>>> tf.write("aaaa %s" % 123)
>>>>> tf.close()
> 
> |>>> import os
> |>>> os.getcwd()
> 
Also, os.chdir(path) to change it, although it's better to work with 
absolute paths than change the working directory.



More information about the Python-list mailing list