1>>> import os
2>>> os.path.abspath("mydir/myfile.txt")
3'C:/example/cwd/mydir/myfile.txt'
4
1>>> import pathlib
2>>> p = pathlib.PureWindowsPath(r'\dir\anotherdir\foodir\more')
3>>> print(p)
4\dir\anotherdir\foodir\more
5>>> print(p.as_posix())
6/dir/anotherdir/foodir/more
7>>> str(p)
8'\\dir\\anotherdir\\foodir\\more'
9>>> str(p.as_posix())
10'/dir/anotherdir/foodir/more'
11
1data_folder = "source_data/text_files/"
2
3file_to_open = data_folder + "raw_data.txt"
4
5f = open(file_to_open)
6
7print(f.read())