import turtle as t
t.title("自动轨迹绘制")
t.setup(800,600,0,0)
t.pencolor("red")
t.pensize(5)
datals=[]
f=open("data.txt")
for line in f:
line=line.replace("","")
datals.append(list(map(eval,line.split(","))))
print(f.read())
f.close()
for i in range(len(datals)):
t.pencolor(datals[i][3],datals[i][4],datals[i][5])
t.fd(datals[i][0])
if datals[i][1]:
t.right(datals[i][2])
else:
t.left(datals[i][2])
import turtle as t
t.title("自动轨迹绘制")
t.setup(800,600,0,0)
t.pencolor("red")
t.pensize(5)
datals=[]
a=open("data.txt","r")
#print(a.read())for i in a:
i=i.replace("","")
#print("i:",i)
m=i.split(",")
#print(">>>>>"*3)#print("m",m)#print("<<<<<"*3)
b=map(eval,m)
#print("b:",list(b))#print("//////") datals.append(list(b))
#print(datals)#print("
")a.close()
for i in range(len(datals)):
t.pencolor(datals[i][3],datals[i][4],datals[i][5])
t.fd(datals[i][0])
if datals[i][1]:
t.right(datals[i][2])
else:
t.left(datals[i][2])