osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Python console's workspace path


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.