Why os.getcwd returns "/" instead of "/storage/emulated/0/qpython/personal_directory"?

29 views
Skip to first unread message

Jean-Louis Subra

unread,
Jul 3, 2018, 7:24:39 AM7/3/18
to QPython
Hi,

Another question. It's not convenient to write all the path because it's not always the same on different devices. Then I use the same under-tree in all devices and start from it. For example, I have "qpython/EPG/Progs" and "qpython/EPG/Data". I can read files in "Data" from "Progs" without writing the path from "/" to "EPG".

But if I can use with Python Windows commands :
- "os.getcwd()" which gives "C:\Users\Jean-Louis\Documents\EPG",
- "os.path.dirname (os.getcwd())" which gives "C:\Users\jean-louis\Documents\EPG\Progs",
I have only "/" with these 2 commands with QPython.

Can you explain why?

Thank you.
Jean-Louis
Reply all
Reply to author
Forward
0 new messages