portable way to get current directory - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: portable way to get current directory (/thread-19059.html) |
portable way to get current directory - Skaperen - Jun-12-2019 does Python have a portable way to get the path of the current (working) directory? RE: portable way to get current directory - SheeppOSU - Jun-12-2019 Yes, I use it all the time from pathlib import Path current_directory = Path(__file__).parent RE: portable way to get current directory - metulburr - Jun-12-2019 import os cwd = os.getcwd() RE: portable way to get current directory - Skaperen - Jun-12-2019 os stuff even works on Windows? RE: portable way to get current directory - perfringo - Jun-12-2019 From documentation
RE: portable way to get current directory - Skaperen - Jun-12-2019 what if i want to os.dup2() a file descriptor? i didn't know Windows had file descriptors. |