Python console's workspace path

Chris Angelico rosuav at gmail.com
Tue Sep 5 10:38:12 EDT 2017


On Wed, Sep 6, 2017 at 12:26 AM, Andrej Viktorovich
<viktorovichandrej at gmail.com> wrote:
> 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()
>
> Where file aaa.txt will be created? Can I change default work space location? How?

Easy way to find out:

>>> import os
>>> os.getcwd()
'/home/rosuav'

ChrisA



More information about the Python-list mailing list