I have 2 text fields , and one select file button . I need to use this button to select two files and fill the file name in its corresponding text field. I've tried the following code but the problem with it is I need to select the two files in consecutive way (which doesn't give a good user experience since the first file is in first text field and the second is on the 5th text field). So, I need a way to select those files not in a consecutive manner. Code:
def browse():
file_types = {("unverified points file","*.rpt"):inputtxt1, ("Session (.fss) or fm_script (.tcl) files","*.fss *.tcl"):inputtxt5}
for key, value in file_types.items():
filename =filedialog.askopenfilename(title=f'Select {key[0]}', filetypes=(key,("All files","*.*")))
value.insert(tkinter.END, filename)
source https://stackoverflow.com/questions/69352148/using-same-button-to-select-two-non-conseuctive-files-in-tkinter
Comments
Post a Comment