# run python file # # Run a file from disk with the current python context filename = get_open_filename_input("Python File:") if filename: exec(open(filename).read()) else: show_message_box("Invalid python file", "Invalid python file selected.", MessageBoxButtonSet.OKButtonSet, MessageBoxIcon.ErrorIcon)