使用Python做一个简易的选课小程序!大学必备技能!

本文介绍了如何使用Python的Tkinter库和ttk模块创建一个简单的选课系统。该系统包含两个列表框,一个显示可用课程,另一个显示已选课程。用户可以通过按钮在两者之间移动课程。课程包括'Python程序设计','面向对象程序设计'等,系统界面友好,适合初学者实践。" 102767457,7852800,React项目集成eslint与pre-commit,"['前端开发', 'JavaScript', 'React', '代码规范', 'Git']
摘要由CSDN通过智能技术生成

 

编写选课程序。左侧列表框显示学生可以选择的课程名称,右侧列表框显示学生已经选择的课程名通过四个按钮再两个列表框中移动数据项。

 
 

from tkinter import * from tkinter import ttk billwindows=Tk() billwindows.title("Bill选课系统") def callbutton1(): for i in theLeftBox.curselection(): theRightBox.insert(0, theLeftBox.get(i)) theLeftBox.delete(i) def callbutton2(): for i in theRightBox.curselection(): theLeftBox.insert(0, theRightBox.get(i)) theRightBox.delete(i) def callbutton3(): for i in range(0, theLeftBox.size()): theRightBox.insert(0, theLeftBox.get(i)) for i in range(theLeftBox.size() - 1, -1, -1): theLeftBox.delete(i) def callbutton4(): for i in range(0, theRightBox.size()): theLeftBox.insert(0, theRightBox.get(i)) for i in range(theRightBox.size() - 1, -1, -1): theRightBox.delete(i) KCB=["Python程序设计","面向对象程序设计","计算机网络","单片机","如何一夜暴富","如何找到一个女朋友"] #billwindows.geometry('1200x800') theRightBox = Listbox(billwindows) theLe

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值