I have a python script that does stuff with pandas. I've created a GUI in tkinter that will assign user inputs to different global variables. I need to keep everything in the same file. Here is a snippet of what I'm doing:
#Global Variables with default values
Winrate = 0
# Button Functions
def getWinRate():
global Winrate
Winrate = win_rate_entry.get()
messagebox.showinfo('Successful Entry!')
def RunPipelineScript():
print("Do stuff")
start_script_btn = Button(window, text="Start Script", command= RunPipelineScript())
# Rest of the script is below. It uses the values inputted by the user, e.g. WinRate entry, in the #calculations
I essentially want to make it so that when the Start Script button is clicked the rest of the script executes. I'm not sure how to go about this. Should I just paste the rest of the script into the "RunPipelineScript" function? If so will the global variables have been changed based on the users entries? Could I just make it so that once the user has inputted the appropriate entries the RunPipelineScript function will just jump to a certain line and continue to execute the program as normal?
As you can see I'm a novice at Python and Pandas, and any help you can provide would be most appreciated :)