[英]Python Turtle write() syntax error
我有个问题。 我正在学习Python,但出现EOL错误。 我在寻找解决方案,但什么也没找到。
def gefangen(mx,my):
if not geschafft:
paula.write('Super, du hast Paula erwischt!')
else:
paula.write('Das zählt ja wohl nicht?!')
onclick(start) # Mauskoordinaten werden
paula.onclick(gefangen) # automatisch übergeben
while paula.distance(horst) > 4:
horst.fd(randint(3,7))
horst.lt(randint(-20,40)/10)
paula.setheading(paula.towards(horst))
paula.fd(randint(1,10))
if count % 20 == 0:
horst.stamp()
paula.stamp()
count += 1
if horst.ycor()<-260 or horst.xcor()>310:
horst.write('Puh, geschafft!')
paula.write('Mist, entwischt!')
geschafft=True
break
if not geschafft:
horst.write("Erwischt!",font=("Arial",14,"bold")")
pu()
goto(-200,-200)
shape("circle")
write("Noch einmal? Hier klicken")
pd()
st()
http://prntscr.com/gstq0d我收到此错误(查看屏幕截图)
看来您在"bold")")
处有一个额外的双引号"bold")")
...
if not geschafft:
horst.write("Erwischt!",font=("Arial",14,"bold")")
horst.write( “Erwischt!”,字体=( “Arial字体”,14, “黑体”)“)
在此行中,您在末尾加了双引号。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.