📜  windows如何将文件路径存储为可变python代码示例

📅  最后修改于: 2022-03-11 14:47:20.778000             🧑  作者: Mango

代码示例1
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