When using pathlib, getting error: TypeError: invalid file: PosixPath('example.txt')

from pathlib import Path filename = Path(__file__).parent / "example.txt" contents = open(filename, "r").read() But I get this error on some machines:html TypeError: invalid file: PosixPath('example.
相关文章
相关标签/搜索