pycharm运行后秒退是什么原因啊啊啊?
pycharm吧
全部回复
仅看楼主
level 1
#ClickAndSmile.py
import random
import turtle
t = turtle.Pen()
t.speed(0)
t.hideturtle()
turtle.bgcolor("black")
def draw_smiley(x,y):
t.penup()
t.setpos(x,y)
t.pendown()
# Face
t.pencolor("yellow")
t.fillcolor("yellow")
t.begin_fill()
t.circle(50)
t.end_fill()
# Left eye
t.setpos(x-15, y+60)
t.fillcolor("blue")
t.begin_fill()
t.circle(10)
t.end_fill()
# Right eye
t.setpos(x+15, y+60)
t.begin_fill()
t.circle(10)
t.end_fill()
# Mouth
t.setpos(x-25, y+40)
t.pencolor("black")
t.width(10)
t.goto(x-10, y+20)
t.goto(x+10, y+20)
t.goto(x+25, y+40)
t.width(1)
turtle.onscreenclick(draw_smiley)
这是我的代码,在python3中运行就可以画图,但是pycharm中跑了以后就直接退出了,画不了。小白一枚,求吧友帮忙。
2018年03月17日 01点03分 1
level 1
加一句turtle.mainloop()试试
2018年04月28日 01点04分 2
1