Python龟图形窗口没有出现

时间:2016-04-05 05:15:33

标签: python python-2.7 turtle-graphics

我最近在python版本2.7.11中关注了龟的教程。问题是,龟图形的窗口没有显示出来,在python shell中它会读取文件路径,然后重新启动"。我还在mac OS X.10.11.4上重新安装了python和我。

谢谢

 select * from  (SELECT TO_DATE(PRODUCT_FINISH_DATE) - TO_DATE(PRODUCT_START_DATE) FROM MANUFACTURED_PRODUCT ORDER BY PRODUCT_START_DATE ASC) where rownum=1;

1 个答案:

答案 0 :(得分:0)

你应该正确缩进。确保调用draw_square()的行不在函数定义之外:

import turtle

def draw_square():
    window = turtle.Screen()
    window.bgcolor("red")

    brad = turtle.Turtle()
    brad.shape("turtle")
    brad.color("yellow")
    brad.speed(2)

    brad.forward(100)
    brad.right(90)

    window.exitonclick()

draw_square()

screenshot of the program running