pathlib.Path vs. os.path.join in Python
When I need to define a file system path in my script, I use os.path.join to guarantee that the path will be consistent on different file systems: from os import path path_1 = path.join("/home", "test", "test.txt") I also know that there is the pathlib module that basically does the same: from pathlib import Path path_2 = Path("/home") / "test" / "test.txt"