Skip to content

Instantly share code, notes, and snippets.

@sarojbelbase
Created December 22, 2020 16:44
Show Gist options
  • Save sarojbelbase/1caff11d39efd0b8e843930a46d7e3bd to your computer and use it in GitHub Desktop.
Save sarojbelbase/1caff11d39efd0b8e843930a46d7e3bd to your computer and use it in GitHub Desktop.
Better way to hack path system on windows, mac and linux.
from pathlib import Path
data_folder = Path("source_data/text_files/")
file_to_open = data_folder / "raw_data.txt"
f = open(file_to_open)
print(f.read())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment