我在Python上的代码有问题我不知道该怎么办?请帮我 [英] I have problem with code at the Python I don't know what to do ? please help me

查看:99
本文介绍了我在Python上的代码有问题我不知道该怎么办?请帮我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码问题是按钮无法使用此代码



我尝试了什么:



< pre>来自tkinter import * 
import tkinter.messagebox as tkMessageBox
import mysql.connector
root = Tk ()
root.title(登录软件)
#=================设置主框架======== =========
width = 640
height = 480
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
x = (screen_width / 2) - (width / 2)
y =(screen_height / 2) - (height / 2)
root.geometry(%dx%d +%d +%d%(宽度,高度) ,x,y))
root.resizable(0,0)
#=================设计布局======= ==============
Top = Frame(root,bd = 2,relief = RIDGE)
Top.pack(side = TOP,fill = X)
Form = Frame(root,height = 200)
Form.pack(side = TOP,pady = 20)
#================= =============变量==================================== ==

USERNAME = StringVar( )
PASSWORD = StringVar()
#=================设计布局=============== ==
lbl_title = Label(Top,text =Python:Simple Login Application,font =('arial',15))。pack(fill = X)
lbl_username = Label(Form,text =用户名:,font =('arial',14),bd = 15).grid(row = 0,sticky =e)
lbl_password = Label(Form,text =Password:, font =('arial',14),bd = 15).grid(row = 1,sticky =e)
lbl_text = Label(Form).grid(row = 2,columnspan = 2)
username = Entry(Form,textvariable = USERNAME,font =(14))。grid(row = 0,column = 1)
password = Entry(Form,textvariable = PASSWORD,show =*,font =(14))。grid(row = 1,column = 1)
b = Button(Form,text =OK,command = login).pack()
#====== ==================================初始化=============== ====================
root.mainloop()

解决方案

从这里开始: pdb - Python调试器 - Python 3.7.3文档离子 [ ^ ]

 b =按钮(Form,text =   OK ,command = login).pack()



执行登录功能的代码在哪里?


the problem of the code of me is button not working on this code

What I have tried:

<pre>from tkinter import *
import tkinter.messagebox as tkMessageBox
import mysql.connector
root = Tk()
root.title("login software")
 # ================= Setting up the Main Frame =================
width = 640
height = 480
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
x = (screen_width/2) - (width/2)
y = (screen_height/2) - (height/2)
root.geometry("%dx%d+%d+%d" % (width, height, x, y))
root.resizable(0, 0)
     # ================= Designing the Layout ===================== 
Top = Frame(root, bd=2,  relief=RIDGE)
Top.pack(side=TOP, fill=X)
Form = Frame(root, height=200)
Form.pack(side=TOP, pady=20)
#==============================VARIABLES======================================

USERNAME = StringVar()
PASSWORD = StringVar()
 # ================= Designing the Layout =================
lbl_title = Label(Top, text = "Python: Simple Login Application", font=('arial', 15)).pack(fill=X)
lbl_username = Label(Form, text = "Username:", font=('arial', 14), bd=15).grid(row=0, sticky="e")
lbl_password = Label(Form, text = "Password:", font=('arial', 14), bd=15).grid(row=1, sticky="e")
lbl_text = Label(Form).grid(row=2, columnspan=2)
username = Entry(Form, textvariable=USERNAME, font=(14)).grid(row=0, column=1)
password = Entry(Form, textvariable=PASSWORD, show="*",font=(14)).grid(row=1, column=1)
b = Button(Form, text="OK", command= login ).pack()
#========================================INITIALIZATION===================================
root.mainloop()

解决方案

Start here: pdb — The Python Debugger — Python 3.7.3 documentation[^]


b = Button(Form, text="OK", command= login ).pack()


Where is the code that performs the login function?


这篇关于我在Python上的代码有问题我不知道该怎么办?请帮我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆