I take a string from a tkinter dialog window:
from tkinter import filedialog def get_register_path_and_filename(initialfile=""): filename = file