Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Python
  1  from tkinter import *
  2  import tkinter as tk
  3  from tkinter import messagebox
  4  
  5  root =tk.Tk()
  6  root.title("sam's pizzeria shop!!!")
  7  root.geometry('500x500')
  8  root.resizable(0,0)
  9  
 10  def login():
 11  
 12      loginpage = tk.Tk()
 13      loginpage.title("login page")
 14      loginpage.geometry('400x400')
 15      loginpage.resizable(0, 0)
 16      buttonlogin  = Button(loginpage, text="new login     ",padx=20,pady=10, command=new_login)
 17      buttonlogin.pack()
 18      buttonlogin.place(x=50, y=200)
 19      buttonexistinglogin = Button(loginpage, text="existing login", padx=20, pady=10,)
 20      buttonexistinglogin.pack()
 21      buttonexistinglogin.place(x=250, y=200)
 22      Label3 =Label(loginpage, text='registration form',font='arial 10 bold').grid(row=0, column=3 )
 23  
 24  
 25  def new_login():
 26      new_login = tk.Tk()
 27      new_login.title("new login page")
 28      new_login.geometry('400x200')
 29      new_login.resizable(0, 0)
 30      Label3 =Label(new_login, text="Name:",font='arial 10 bold',padx=0, 
 31      pady=1)
 32      Label3.pack()
 33      Label4 = Label(new_login, text="Email:", font='arial 10 bold',padx=2, 
 34      pady=2)
 35      Label4.pack()
 36      Label5 = Label(new_login, text="password:", font='arial 10 bold',padx=3, 
 37      pady=3)
 38      Label5.pack()
 39      entry1 = Entry(new_login,x = 1,y = 2 )(here is the problem)
 40      entry1.pack()
 41  
 42  def cart():
 43      window= tk.Tk()
 44      window.title("cart")
 45      window.geometry('300x300')
 46      window.resizable(0, 0)
 47  
 48  def click():
 49      myLable = Label(root, text='hello ')
 50      myLable.pack()
 51      mylable2 = Label(root, text='''thank you so much for coming today,
 52  this is our menu
 53  pizza(veg)
 54  pizza(non-veg)
 55  stater
 56  dipping
 57  ''')
 58      mylable2.pack()
 59  
 60  
 61  button2 = Button(root, text="margarita pizza",padx=41.5,)
 62  button2.pack()
 63  button2.place(x=0,y=100)
 64  
 65  button3 = Button(root, text="veg loaded pizza ",padx=37,)
 66  button3.pack()
 67  button3.place(x=0,y=125)
 68  
 69  button4 = Button(root, text="veg supreme pizza ",padx=32,)
 70  button4.pack()
 71  button4.place(x=0,y=150)
 72  
 73  button5 = Button(root, text="non-veg Supreme pizza",padx=20,)
 74  button5.pack()
 75  button5.place(x=0,y=175)
 76  
 77  button6 = Button(root, text="barbecue chicken pizza",padx=21,)
 78  button6.pack()
 79  button6.place(x=0,y=200)
 80  
 81  button7 = Button(root, text="indian chicken tikka pizza",padx=15,)
 82  button7.pack()
 83  button7.place(x=0,y=225)
 84  
 85  button8 = Button(root, text="Chicken Wings ",padx=41,)
 86  button8.pack()
 87  button8.place(x=0,y=250)
 88  
 89  button9 = Button(root, text="chicken nuggets ",padx=37,)
 90  button9.pack()
 91  button9.place(x=0,y=275)
 92  
 93  button10 = Button(root, text="pocket pizza ",padx=48,)
 94  button10.pack()
 95  button10.place(x=0,y=300)
 96  
 97  button11 = Button(root, text="ranch  ",padx=64,)
 98  button11.pack()
 99  button11.place(x=0,y=325)
100  
101  button12= Button(root, text="peri-peri ",padx=58,)
102  button12.pack()
103  button12.place(x=0,y=350)
104  
105  button13 = Button(root, text="blue cheese ",padx=49.5,)
106  button13.pack()
107  button13.place(x=0,y=375)
108  
109  button14 = Button(root, text="login",padx=49.5,command=login)
110  button14.pack()
111  button14.place(x=363,y=0)
112  
113  buttoncart = Button(root, text="cart ",padx=20,command=cart)
114  buttoncart.pack()
115  buttoncart.place(x=0,y=473)
116  
117  buttonexit = Button(root, text="exit button",padx=40,command=exit)
118  buttonexit.pack()
119  buttonexit.place(x=352,y=473)
120  buttoncart["state"] = "disabled"
121  button2["state"] = "disabled"
122  button3["state"] = "disabled"
123  button4["state"] = "disabled"
124  button5["state"] = "disabled"
125  button6["state"] = "disabled"
126  button7["state"] = "disabled"
127  button8["state"] = "disabled"
128  button9["state"] = "disabled"
129  button10["state"] = "disabled"
130  button11["state"] = "disabled"
131  button12["state"] = "disabled"
132  button13["state"] = "disabled"
133  
134  
135  
136  root.mainloop()


What I have tried:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1892, in __call__
    return self.func(*args)
  File "C:\Users\DELL\PycharmProjects\app devlopment\app development.py", line 36, in new_login
    entry1 = Entry(new_login,x = 1,y = 2 )
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 3035, in __init__
    Widget.__init__(self, master, 'entry', cnf, kw)
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 2572, in __init__
    self.tk.call(
_tkinter.TclError: unknown option "-y"


i have tried to changing it to
 entry1 = Entry(new_login,padx = 1,pady = 2 )(here is the problem)
entry1.pack()

but same error
Posted
Updated 4-Nov-22 1:59am
v2
Comments
Richard MacCutchan 4-Nov-22 8:04am    
The message is telling you that the Entry widget does not have a parameter named y. Check the documentation to see which options are valid.

1 solution

The error is telling you that the Entry widget doesn't have x and y options.

The fact that your altered code has the same error tells you that it doesn't have padx or pady options.

The solution depends on precisely what you're trying to do. For example, perhaps you meant to place the widget?
Python
entry1 = Entry(new_login)
entry1.place( x = 1, y = 2 )
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900