首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
首页
>
试题广场
>
3 [问答]设计一个窗体,模拟QQ登录界面,当用户输入号码1
[问答题]
设计一个窗体,模拟QQ登录界面,当用户输入号码123456和密码654321时提示正确,否则提示错误。
查看答案及解析
添加笔记
求解答(2)
邀请回答
收藏(16)
分享
纠错
2个回答
添加回答
0
创始元灵
import wx
class QQ(wx.Frame):
def __init__(self, superion):
wx.Frame.__init__(self, parent=superion, title='QQ', size=(300,200),pos=(350,350))
panel = wx.Panel(self)
panel.SetBackgroundColour('Red')
label1=wx.StaticText(panel,-1,'账号:',pos=(0,10),style=wx.ALIGN_CENTER)
label1=wx.StaticText(panel,-1,'密码:',pos=(0,30),style=wx.ALIGN_CENTER)
self.username=wx.TextCtrl(panel,-1,pos=(70,10),size=(160,20))
self.password=wx.TextCtrl(panel,pos=(70,30),size=(160,20),style=wx.TE_PASSWORD)
self.buttonOK = wx.Button(parent=panel, label='登录', pos=(70,60))
self.Bind(wx.EVT_BUTTON, self.OnButtonCheck, self.buttonOK)
self.buttonRes = wx.Button(parent=panel, label='注册', pos=(70,90))
self.Bind(wx.EVT_BUTTON, self.OnButtonRes, self.buttonRes)
def OnButtonCheck(self, event):
user=self.username.GetValue()
psw=self.password.GetValue()
if user == 'chuangshiyuanling' and psw == 'chuangshiyuanling07':
wx.MessageBox('成功!')
else:
wx.MessageBox('你输入的账号或密码有误!')
def OnButtonRes(self,event):
wx.MessageBox("账号:chuangshiyuanling密码:chuangshiyuanling07")
if __name__ == '__main__':
app = wx.App()
frame = QQ(None)
frame.Show()
app.MainLoop()
编辑于 2019-07-20 17:52:00
回复(0)
0
菜鸡继续等offer
tkinter
发表于 2019-03-13 00:30:36
回复(0)
这道题你会答吗?花几分钟告诉大家答案吧!
提交观点
问题信息
Python
上传者:
小小
难度:
2条回答
16收藏
1921浏览
热门推荐
相关试题
假定一个待哈希存储的线性表为(32...
哈希
评论
(1)
5.下列判断正确的是( )
资料分析
言语理解与表达
资料分析
评论
(1)
《拳皇97》最后BOSS是谁?
游戏常识
评论
(1)
《魔兽世界》中,下列不属于玩家可以...
游戏常识
评论
(1)
你有没有崇拜的偶像,你欣赏他/她身...
通用能力
评论
(1)
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题