I\'m a web application development noob. I have a function that opens a file and reads it. Unfortunately, the directory structures between the test and production servers di
If you are using pathlib for filenames then you can use on both Windows and Linux (I came here for a windows answer):
python from pathlib import Path p = Path('~').expanduser() print(p)