Answers for "how to insert filepath in python windows 10"

1

how to add path to python in windows

Simply add this path to your PYTHONPATH environment variable. 
To do this, go to Control Panel / System / Advanced / Environment variable, 
and in the "User variables" sections, check if you already have PYTHONPATH. 
If yes, select it and click "Edit", if not, click "New" to add it.

Paths in PYTHONPATH should be separated with ";".
Posted by: Guest on November-28-2021
0

windows how to store filepath as variabley python

from pathlib import Path

docs_folder = Path("some_folder/some_folder/")
text_file = docs_folder / "some_file.txt"
f = open(text_file)

#note must use forward slashes as pathlib will convert these to \ for windows
Posted by: Guest on October-03-2020

Code answers related to "how to insert filepath in python windows 10"

Python Answers by Framework

Browse Popular Code Answers by Language