how to open file at a particular location python code example
Example 1: python open file same folder
import os
with open(os.path.join(sys.path[0], "my_file.txt"), "r") as f:
print(f.read())
Example 2: open file in python directory
path = 'C:\\Users\\Username\\Path\\To\\File'
file=open(path, "r")