def callback(): try: home2 = renameWrapper('players', 'serie A', entry.get()) away2 = renameWrapper('players', 'serie A', entry2.get()) game = [{'Away': entry2.get(),'Home': entry.get(), 'Home Goals': main.predictGame('serie A', entry.get(), entry2.get())[0], 'Away Goals': main.predictGame('serie A', entry.get(), entry2.get())[1], 'Home Attack Rating': main.averagesHome('serie A', home2)[0], 'Away Attack Rating': main.averagesAway('serie A', away2)[0], 'Home Midfield Rating': main.averagesHome('serie A', home2)[1], 'Away Midfield Rating': main.averagesAway('serie A', away2)[1], 'Home Defense Rating': main.averagesHome('serie A', home2)[2], 'Away Defense Rating': main.averagesAway('serie A', away2)[2], 'Home Best Player': main.averagesHome('serie A', home2)[3], 'Away Best Player': main.averagesAway('serie A', away2)[3], 'Home Player Age': main.averagesHome('serie A', home2)[4], 'Away Player Age': main.averagesAway('serie A', away2)[4] }] df = pd.DataFrame(game, columns=['Home', 'Home Goals', 'Away', 'Away Goals', 'Home Attack Rating', 'Away Attack Rating', 'Home Midfield Rating', 'Away Midfield Rating', 'Home Defense Rating', 'Away Defense Rating', 'Home Best Player', 'Away Best Player', 'Home Player Age', 'Away Player Age']) self.table = pt = Table(frame1, dataframe=df, showtoolbar=False, showstatusbar=True) pt.show() except: for i in range(18): if i == 17 and entry.get() != main.getTeams('serie A')['Teams'][i]: label3 = Label(self, text='No Such Home Team', fg='red') label3.pack() elif entry.get() != main.getTeams('serie A')['Teams'][i]: continue elif entry.get() == main.getTeams('serie A')['Teams'][i]: break for i in range(18): if i == 17 and entry2.get() != main.getTeams('serie A')['Teams'][i]: label3 = Label(self, text='No Such Away Team', fg='red') label3.pack() elif entry2.get() != main.getTeams('serie A')['Teams'][i]: continue elif entry2.get() == main.getTeams('serie A')['Teams'][i]: break
def drawHeadToHead(frame = None): df = main.getTeams('serie A') self.table = pt = Table(frame1, dataframe=df, showtoolbar=False, showstatusbar=True) pt.show()