当前位置:   article > 正文

Python 图书管理系统 有GUI界面 (源码在最后)【含Python源码 MX_001期】_python图形界面图书管理系统代码

python图形界面图书管理系统代码

部分效果图:

部分源码:

  1. def creatPage(self):
  2. self.addPage = AddFrame(self.root)#录入界面
  3. self.deletePage = DeleteFrame(self.root) #删除界面
  4. self.countPage = CountFrame(self.root) #统计界面
  5. self.register_admirPage = Register_admirFrame(self.root) #添加新管理员界面
  6. self.addPage.pack()#默认录入界面
  7. menubar = Menu(self.root)
  8. menubar.add_command(label = '录入书籍',command = self.addData)
  9. menubar.add_command(label = '删除书籍',command = self.deleteData)
  10. menubar.add_command(label = '统计书籍',command = self.countData)
  11. menubar.add_command(label = '添加管理员',command = self.register_admirData)
  12. self.root['menu'] = menubar #设置菜单栏
  13. def addData(self):
  14. self.addPage.pack()
  15. self.deletePage.pack_forget()
  16. self.countPage.pack_forget()
  17. self.register_admirPage.pack_forget()
  18. def deleteData(self):
  19. self.addPage.pack_forget()
  20. self.deletePage.pack()
  21. self.countPage.pack_forget()
  22. self.register_admirPage.pack_forget()
  23. def countData(self):
  24. self.addPage.pack_forget()
  25. self.deletePage.pack_forget()
  26. self.countPage.pack()
  27. self.register_admirPage.pack_forget()
  28. def register_admirData(self):
  29. self.addPage.pack_forget()
  30. self.deletePage.pack_forget()
  31. self.countPage.pack_forget()
  32. self.register_admirPage.pack()
  1. def loginCheck(self):
  2. name = self.username.get()
  3. password = self.password.get()
  4. f = open('login_true.txt')
  5. for line in f:
  6. str = line.strip()
  7. str2 = ','
  8. user_name = str[:str.index(str2)]
  9. pass_word = str[str.index(str2)+1:]
  10. if name == user_name and pass_word == password:
  11. temp = 1
  12. break
  13. else:
  14. temp = 0
  15. if temp == 1 :
  16. self.page.destroy()
  17. User_MainPage(self.root)
  18. elif temp == 0 :
  19. showinfo(title = '失败', message = '账号或密码错误,重新登录!')
  20. def admir_loginCheck(self):
  21. admir_name = self.username.get()
  22. admir_password = self.password.get()
  23. f1 = open('login_admir.txt')
  24. for line1 in f1:
  25. str = line1.strip()
  26. str1 = ','
  27. admir_name_txt = str[:str.index(str1)]
  28. admir_password_txt = str[str.index(str1)+1:]
  29. if admir_name == admir_name_txt and admir_password == admir_password_txt:
  30. temp = 3
  31. break
  32. else:
  33. temp = 4
  34. if temp == 3:
  35. self.page.destroy()
  36. Admir_MainPage(self.root)
  37. elif temp == 4:
  38. showinfo(title='失败', message='账号或密码错误,重新登录!')

 源码:图书管理系统

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/726979
推荐阅读
相关标签
  

闽ICP备14008679号