求大佬们,帮我看看我的这个代码为什么最后看效果时不能显示文字呢?拜托拜托
#!/usr/bin/env python# -*- coding:utf-8 -*-
import turtle
import time
# 画心形圆弧
def hart_arc():
for i in range(200):
turtle.right(1)
turtle.forward(2)
def move_pen_position(x, y):
turtle.hideturtle()
turtle.up()
turtle.goto(x, y)
turtle.down()
turtle.showturtle()
love = input("请输入表白话语,默认为 ‘I Love You’:")
signature = input("请签署你的大名,不填写默认不显示:")
if love == ' ' :
love == 'I Love You'
# 初始化
turtle.setup(width=800, height=500)
turtle.color('red', 'pink')
turtle.pensize(3)
turtle.speed(1)
# 初始化画笔起始坐标
move_pen_position(x=0, y=-180)
turtle.left(140)
turtle.begin_fill()
# 画心形直线 ( 左下方 )
turtle.forward(224)
# 画爱心圆弧
hart_arc()
turtle.left(120)
hart_arc()
# 画心形直线 ( 右下方 )
turtle.forward(224)
turtle.end_fill()
# 在心形中写上表白话语
move_pen_position(0,0)
turtle.hideturtle()
turtle.color('blue ')