how can I get an entry into tkinter as I am using class frame, this is what I did but its not working from tkinter import * import tkinter as tk from...
View the step-by-step solution to:

Question

how can I get an entry into tkinter as I am using class frame, this is what I did but its not working

from

tkinter import *

import tkinter as tk

from PIL import Image, ImageTk

from datetime import *


class NorthSpineCanteenApp(tk.Tk):

  def __init__(self, *args, **kwargs):

     

    tk.Tk.__init__(self, *args, **kwargs)

     

    self.geometry("600x600")

    container=tk.Frame(self)

    container.pack(side="top", fill="both",expand=True)

     

    container.grid_rowconfigure(0,weight=1)

    container.grid_columnconfigure(0,weight=1)

   

    self.frame={}   

    for F in (mainpage,MenuPage,DateAndTime,MondayMenu_AM,MondayMenu_PM,TuesdayMenu_AM,TuesdayMenu_PM,WednesdayMenu_AM,WednesdayMenu_PM,ThursdayMenu_AM,ThursdayMenu_PM,FridayMenu_AM,FridayMenu_PM,SaturdayMenu_AM,SaturdayMenu_PM,SundayMenu_AM,SundayMenu_PM):

      frame=F(container,self)

     

      self.frame[F]=frame


      frame.grid(row=0,column=0,sticky="nsew")

    self.show_frame(mainpage)

   

  def show_frame(self, cont):

    frame=self.frame[cont]

    frame.tkraise()

   

      


   

     


class mainpage(tk.Frame):

  def __init__(self, parent, controller):

    tk.Frame.__init__(self,parent)

   

    mainmenu_button=tk.Button(self, text="Today's Menu", command=lambda:controller.show_frame(MenuPage))

    mainmenu_button.pack(side="bottom")

     

    sec_button=tk.Button(self, text="Menu By Date And Time",command=lambda:controller.show_frame(DateAndTime))

    sec_button.pack(side="bottom")

     

   

     

class MenuPage(tk.Frame):

  def __init__(self,parent,controller):

    tk.Frame.__init__(self,parent)

    today=datetime.now()

    today_date=tk.Label(self, text=today)

    today_date.pack()

     


    button1=tk.Button(self, text="Mini Wok")

    button1.pack(side=LEFT)

    button2=tk.Button(self, text="Mc Donalds")

    button2.pack(side=LEFT)

    button3=tk.Button(self, text="Home Page", command=lambda:controller.show_frame(mainpage))

    button3.pack(side=BOTTOM)

class DateAndTime(tk.Frame):

  def __init__(self,parent,controller):

    tk.Frame.__init__(self,parent)

    def getinput(self, event):

      day=entry1.get

    def Submit_Date_Time():

      day=entry1.get()

      month=entry2.get()

      year=entry3.get()

      hours=Hours_entry.get()

      minutes=Minutes_entry.get()

      print(day)

      print(month)

      print(year)

    weekdayvalue=8

    Time=0


    Date=tk.Label(self, text="Day").grid(row=5)

    entry1=tk.Entry(self)

    entry1.grid(row=5,column=1)

    Month=tk.Label(self,text="Month")

    Month.grid(row=5,column=2)

    entry2=tk.Entry(self)

    entry2.grid(row=5,column=3)

    Year=tk.Label(self, text="Year")

    Year.grid(row=5,column=4)

    entry3=tk.Entry(self)

    entry3.grid(row=5,column=5)

    Hours=tk.Label(self, text="Hours").grid(row=6)

    Hours_entry=tk.Entry(self)

    Hours_entry.grid(row=6,column=1)

    Minutes=tk.Label(self, text="Minutes")

    Minutes.grid(row=6,column=3)

    Minutes_entry=tk.Entry(self)

    Minutes_entry.grid(row=6, column=4)

     

    Submit_button=tk.Button(self,text="Submit", command=Submit_Date_Time())

    Submit_button.grid(row=7)

I didnt put up the whole code

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes