看了MOOC的python七段数码管实例,参考编写了14段数码管显示,
import turtle, time
name = []
name1 = []
def drawGap():
turtle.penup()
turtle.fd(5)
def drawLine(draw):
drawGap()
turtle.pendown() if draw else turtle.penup()
turtle.fd(40-10)
drawGap()
turtle.right(90)
def drawLine1(draw):
drawGap()
turtle.pendown() if draw else turtle.penup()
turtle.fd(20-10)
drawGap()
def drawtdown1(draw):
drawGap()
turtle.pendown() if draw else turtle.penup()
turtle.fd(44.7-10)
drawGap()
def drawDigit(digit):
#横1笔
drawLine1(True) if digit in [2,4,5,6,8,9,'A','E','F','H','K','P','R','S'] else drawLine1(False)
#横2笔
drawLine1(True) if digit in [2,3,4,5,6,8,9,'A','B&#