Python - how to wait for user trigger in the middle of a function?
问题 I want to prompt user to choose between yes and no in the middle of a function and then continue the function accordingly. How is it possible? Here is my code: def download_popup(file_name, url, size, threshold): root = Tk() label = Label(root, text="The file {file} at {url} is {size}Bytes large which is larger than your threshold({threshold})." "\nShall I still download it?".format(file_name, url, size, threshold)) yes = ttk.Button(root, width=5, text="yse", command=lambda: return True) no =