一、画图
import turtle
import time
# 曲线移动
def curveMove():
for i in range(200):
turtle.speed(10)
turtle.right(1) # 顺时针旋转
turtle.forward(1) # 前进1px
def curveMove2(): # 第二个半圆
for i in range(180):#第二个心的圆弧度
turtle.speed(10)
turtle.right(1) # 顺时针旋转
turtle.forward(1) # 前进1px
def drawHeart():
turtle.speed(1)
turtle.color('blue','red') # 蓝色画,红色填充
turtle.begin_fill()
turtle.left(140) # 光标左转140度,默认水平向右
turtle.forward(111.65)
curveMove()
turtle.left(120)
curveMove()
turtle.forward(111.65)
turtle.end_fill()
def half_drawHeart(): # 第二个半心
turtle.speed(1)
turtle.color('blue','red') # 蓝色画,红色填充
turtle.begin_fill()
turtle.left(180)
curveMove2() # 第二个心的曲线
# turtle.left(20)
turtle.forward(120) # 第二个心的直线长度
turtle.right(80) # 光标向右偏80度
turtle.forward(45) # 第二个心左边的直线
turtle.end_fill()
def my_goto(x, y):
turtle.penup()
turtle.goto(x,y)
turtle.pendown()
def jiantou():
turtle.speed(1)
turtle.color('blue')
turtle.begin_fill()
turtle.forward(390) # 箭头的直线长度
turtle.left(130) # 左偏,画上边箭头的一部分
turtle.forward(30)
turtle.left(180) # 转回来
turtle.forward(30)
turtle.right(80)
turtle.forward(30)
if __name__ == '__main__':
drawHeart()
my_goto(85, 160)#半心起点坐标
half_drawHeart()
my_goto(-150, 80)
turtle.right(135)
jiantou()
my_goto(230, -300)
turtle.write('by 绵逸', font=('Bradley Hand ITC', 30, 'bold'))
my_goto(230, 300)
time.sleep(10)
二、选课程序
学生:注册,登陆,选课,查看已选课程
老师:登录,查看上课的学生数量
管理员:添加老师,添加课程及对应的老师
'''选课系统'''
student_list = []
teacher_list = []
admin_list = []
'''学生端'''
def read_all_student():
if student_list:
return
with open('学生信息.txt', 'rt', encoding='utf-8')as f:
text = f.read()