编辑代码

from turtle import *
import math
length = 20
angle = 90


def draw_path(path):
    for symbol in path:
        if symbol == 'F':
            forward(length)
        elif symbol == '-':
            left(angle)
        elif symbol == '+':
            right(angle)


path = "F-F-F-F"

speed(0)
start = 1
num = 1279
while 1:
    temp = start
    while temp < num:
        temp *= 10
    ar = (int(temp / num) % math.pi) * (180 / math.pi)
    right(180 - ar)
    forward(ar / 10)
    start = temp - num * int(temp / num)


# draw_path(path)

exitonclick()