Aug-04-2023, 03:32 AM
(This post was last modified: Aug-04-2023, 05:20 AM by Gribouillis.)
Good Evening,
I just learned about the existence of tkinter as I was trying to create a dialog box to allow users to select file, and then import the file in pandas df. I saw plenty of examples online and tutorial on youtube regarding how to create it using the askopenfilename function within tkinter. I got the program to run and return the absolute file path correctly the problem am having and cant seem to find the answer to is that once I close the dialog box after selecting the file. My output windows continues to print the following " r\n\r\n" indefinitely. Ive tried adding .mainloop(), .destroy(), and .quit() after the askopenfile function and nothing seems to work. Any help in understanding what is going on will be greatly appreciate it.
Code:
I just learned about the existence of tkinter as I was trying to create a dialog box to allow users to select file, and then import the file in pandas df. I saw plenty of examples online and tutorial on youtube regarding how to create it using the askopenfilename function within tkinter. I got the program to run and return the absolute file path correctly the problem am having and cant seem to find the answer to is that once I close the dialog box after selecting the file. My output windows continues to print the following " r\n\r\n" indefinitely. Ive tried adding .mainloop(), .destroy(), and .quit() after the askopenfile function and nothing seems to work. Any help in understanding what is going on will be greatly appreciate it.
Code:
import tkinter as tk from tkinter import filedialog root = tk.Tk() file = filedialog.askopenfilename() root.mainloop()
Gribouillis write Aug-04-2023, 05:20 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.