I have a tkinter page that works by calling other tkinter pages, each with their own functions. When I call the page locally, the function works, but when it is called from the other page it doesn't work. The function used to call the other page is this.
from tkinter import *
import subprocess
import tkinter.messagebox
import os.path
class meh:
def __init__ (self,root):
self.root =root
self.root.title("ODIN")
self.root.geometry("1350x750+0+0")
self.root.config(bg="ghost white")
def ap():
subprocess.call(["python.exe",r"C:\Users\felix\Documents\FelixPython\AttendancePageAdmin.py"])
#AttendancePage.Attendance(Tk())
MainFrame = Frame(self.root, bg="Ghost White")
MainFrame.grid()
CallButtonFrame = Frame(MainFrame, bd=2, width=1350, height=70, padx=18, pady=10, bg="blue2", relief = RIDGE)
CallButtonFrame.pack(side=TOP)
self.btnAttend = Button(CallButtonFrame, text = 'Attendance page' , font=('ariel',20,'bold'),height=1,width=10, bd=4, command = ap)
self.btnAttend.grid(row=0, column=0)
if __name__=='__main__':
root = Tk()
application = meh(root)
root.mainloop()