Home > other >  Where is the problem, how to change
Where is the problem, how to change

Time:12-06

Import Cang father 1 as cf
H=Tk ()
I=Frame (h)
I.p ack (padx=100, pady=10)
V1=StringVar ()
V2=StringVar ()
V3=StringVar ()
Entry (I, textvariable=v2, show=",, "width=15, validate=" none "). The grid (row=0, the column=2)
Def (o) :
A=v2. The get ()
If a=="1234567890" :
V3. Set (" login successful!" )
H=Tk ()
I=Frame (h)
I.p ack (padx=100, pady=50)
V4=StringVar ()
V5=StringVar ()
V6=StringVar ()
Entry (I, textvariable=v4, width=10). The grid (row=0, the column=0)
The Label (I, text="+"). The grid (row=0, the column=1)
Entry (I, textvariable=v5, width=10). The grid (row=0, the column=2)
The Label (I, text="="). The grid (row=0, the column=3)
Label (I, textvariable=6). The grid (row=0, the column=4)
N (def) :
A=float (v4. The get ()) + float (v5. The get ())
If round (a)==a:
V6. Set (int) (a)
The else:
V6. Set (a)
Button (I, text="calculation", the command=n). The grid (row=1, the column=2, pady=5)
The else:
Messagebox. Showerror (" ", "your password input error, \ n please check the input!" )
Textvariable=v1, Label (I) the grid (row=0, the column=0)
Label (I, textvariable=v3). The grid (row=1, the column=1)
Button (I, text="login", the command=o). The grid (row=2, the column=1)
V1 set (" please enter the password: ")
Mainloop ()

CodePudding user response:

First, ask questions to clarify, what is wrong, and their check code first, then asked, import Cang father 1 as cf

CodePudding user response:

After the operation error: ValueError: could not convert a string to float: "'

CodePudding user response:

Import Cang father 1 as cf, this is my own a module, does not affect the operation
  • Related