windows how to store filepath as variabley python

Solutions on MaxInterview for windows how to store filepath as variabley python by the best coders in the world

showing results for - "windows how to store filepath as variabley python"
Simone
15 Oct 2019
1from pathlib import Path
2
3docs_folder = Path("some_folder/some_folder/")
4text_file = docs_folder / "some_file.txt"
5f = open(text_file)
6
7#note must use forward slashes as pathlib will convert these to \\ for windows