osdir.com


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

Python console's workspace path


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