In other words if I pass off the folder to someone containing a .txt and .py, and the script is run on their machine from this folder, how can I ensure the file dialog will open with this folder to select the .txt without knowing the absolute path? Referring to initialdir=??
from tkinter import filedialog
from tkinter import *
root = Tk()
root.withdraw()
root.filename = filedialog.askopenfilename(initialdir='/python', title="Select file",
filetypes=[("Text Files", "*.txt")])
print(root.filename)