Posted in Python onFebruary 16, 2019
如下所示:
#彩色螺旋线 import turtle turtle.pensize(2) turtle.bgcolor("black") colors = ["red","yellow","purple","blue"] turtle.tracer(False) for x in range(400): turtle.forward(2*x) turtle.color(colors[x % 4]) turtle.left(91) turtle.tracer(True)
在用pycharm调用Turtle画图时,上面的代码显示一闪而过
最后加上一句turtle.done()即可解决
#彩色螺旋线 import turtle turtle.pensize(2) turtle.bgcolor("black") colors = ["red","yellow","purple","blue"] turtle.tracer(False) for x in range(400): turtle.forward(2*x) turtle.color(colors[x % 4]) turtle.left(91) turtle.tracer(True) turtle.done()
效果如下:
以上这篇解决Pycharm调用Turtle时 窗口一闪而过的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持三水点靠木。
解决Pycharm调用Turtle时 窗口一闪而过的问题
- Author -
James-J声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@