To be even more pedantic, the most python doc consistent answer would be:
mypath = os.path.join('c:', os.sep, 'sourcedir')
Since you also need os.sep for the posix root path:
mypath = os.path.join(os.sep, 'usr', 'lib')
More Related Contents:
- Non-blocking console input?
- How do I hide the console when I use os.system() or subprocess.call()?
- I can’t install pyaudio on Windows? How to solve “error: Microsoft Visual C++ 14.0 is required.”?
- How do I read text from the clipboard?
- Running Python on Windows for Node.js dependencies
- Jupyter Notebook with Python 3.8 – NotImplementedError
- How to find the real user home directory using python?
- What’s the best way to duplicate fork() in windows?
- How to know/change current directory in Python shell?
- ImportError: cannot import name NUMPY_MKL
- Cross-platform space remaining on volume using python
- Python: Start new command prompt on Windows and wait for it finish/exit
- Python Pip install Error: Unable to find vcvarsall.bat. Tried all solutions [duplicate]
- Determining running programs in Python
- How to avoid console window with .pyw file containing os.system call?
- Is there Windows analog to supervisord?
- Run multiple commands in different SSH servers in parallel using Python Paramiko
- Howto determine file owner on windows using python without pywin32
- PyAudio failed to install on Windows 10
- python: unicode in Windows terminal, encoding used?
- Silent printing of a PDF in Python
- Cannot open “.mp4” video files using OpenCV 2.4.3, Python 2.7 in Windows 7 machine
- Launch IPython notebook with selected browser
- Why can’t I handle a KeyboardInterrupt in python?
- Open File in Another Directory (Python)
- Sending ^C to Python subprocess objects on Windows
- Why does the asyncio’s event loop suppress the KeyboardInterrupt on Windows?
- Execute Commands Sequentially in Python?
- How to calculate length of string in pixels for specific font and size?
- Can’t import cv2; “DLL load failed”