A part of my program needs to be able to play MIDI files, so I have an Entry in tkinter that is meant to allow the user to enter the path of one, but for some reason other subroutines within the class won't work with variables inside the class. Any ideas?
class PlaySong(tk.Frame):
def __init__(self, master):
tk.Frame.__init__(self, master)
tk.Label(self, text="Play Song").pack(side="top", fill="x", pady=10)
tk.Label (self,text= r"Enter in path of MIDI file (e.g C:\Users\etc.)").pack(side="top", fill="x", pady=10)
SongPath = tk.Entry(self)
SongPath.pack()
tk.Button(self, text="Enter path", command = self.SongCheck).pack(pady=10)
tk.Button(self, text="Return to main menu",fg="red2", command=lambda: master.switch_frame(MainMenu)).pack(fill="x")
def SongCheck(self):
path = self.SongPath.get()
print(path)