def smmm(u): #f.grid(row=15,column=0,sticky=W,ipadx=600,ipady=17) df = TableModel.getSampleData() pt = Table(leftFrame2,dataframe=u,showtoolbar=True, showstatusbar=True) pt.grid(row=15,column=0,sticky=W,ipadx=345,ipady=17) pt.show()
def load_click(): init_dir = "" if (selected_sport.get() == 1): init_dir = "/home/pete/Documents/dk_player_exports/" elif (selected_sport.get() == 2): init_dir = "/home/pete/Documents/nhl/dk_player_exports/" else: sys.exit("INVALID SPORT SELECTED") player_file = filedialog.askopenfilename(initialdir=init_dir, title='Select Projections') print(player_file) load_label.configure(text=player_file, width=0) save_button.state(['disabled']) optimize_button.state(['!disabled']) try: global ffa_player_projections ffa_player_projections = pd.read_csv(player_file) LoadOptimizer(player_file) player_value = [] AddValueColumn(player_value) ffa_player_projections = ffa_player_projections.assign( Value=player_value) except: sys.exit("Invalid file type") global table table = Table(middle_left_frame, dataframe=ffa_player_projections) table.grid(column=0, row=0, rowspan=2) table.show() add_lock_button.state(['!disabled']) add_exclude_button.state(['!disabled']) remove_lock_button.state(['!disabled']) remove_exclude_button.state(['!disabled'])
def show_details(): # declares that showing will refer to the global variable mentioned above instead of to a local variable for this function global showing # toggles on or off by testing whether or not the details are already showing if showing == False: # flips the switch to on. showing = True # declares all of these future variables as global ones so they can be refered to the next time the function runs. global dt # Simply creates a block of text and appends it to the Mainframe(See below for more details) for each variable. # .grid just forces a positon for the newly created label. dt = Table(mainframe, dataframe=StockQuotesCall()) dt.grid(column=10, row=0, sticky=(N, W, E, S)) dt.show() dt.redraw() else: # No matter what I use, dt.close(), dt.grid_forget, dt.pack_forget, dt.pack_remove, dt.grid_remove, dt.destroy, none of them works properly with the table. # Must be mod error showing = False # dt.grid_forget()