当我输入以下代码时,它可以正常工作:
#==========================================================
# GAME
#==========================================================
from PIL import Image, ImageTk
from turtle import *
import turtle
from random import randint
# GUI options
screen = turtle.Screen()
screen.setup(1225, 1000)
pil_img = Image.open("eightLane.jpg") # Use PIL to open .jpg image.
tk_img = ImageTk.PhotoImage(pil_img) # Convert it into something tkinter can use.
canvas = turtle.getcanvas() # Get the tkinter Canvas of this TurtleScreen.
# Create a Canvas image object holding the tkinter image.
img_obj_id = canvas.create_image(0, 0, image=tk_img, anchor='center')
title("RACING TURTLES")
#==========================
# Creating the turtles
#==========================
#NOTES
# turtle moves down by 30 each time
# turtle notes are
# turtle 1 red
# turtle 2 yellow
# turtle 3 blue
# turtle 4 green
# turtle 5 dark goldenrod
# turtle 6 blue violet
# turtle 7 magenta
# turtle 8 light slate gray
speed(-10) #speed of the turtles lower is faster
#turtle one
one=Turtle() #name of the turtle
one.color('red') #color of the turtle
one.shape('turtle') #shape of the turtle
one.penup() #makes the trail line
one.goto(20,90) #starting space #first number is horizontal position second is vertical
one.pendown()
for turn in range(54): # how many times it rotates
one.right(10) # how far the turtle spins each rotation
#turtle two
two=Turtle()
two.color('yellow')
two.shape('turtle')
two.penup()
two.goto(-40,125)
two.pendown()
for turn in range(54):
two.left(10)
#turtle three
three=Turtle()
three.color('blue')
three.shape('turtle')
three.penup()
three.goto(-110,150)
three.pendown()
for turn in range(54):
three.right(10)
#turtle four
four=Turtle()
four.color('green')
four.shape('turtle')
four.penup()
four.goto(-180,170)
four.pendown()
for turn in range(55):
four.left(10)
#turtle five
five=Turtle()
five.color('dark goldenrod')
five.shape('turtle')
five.penup()
five.goto(-250,185)
five.pendown()
for turn in range(52):
five.right(10)
#turtle six
six=Turtle()
six.color('blue violet')
six.shape('turtle')
six.penup()
six.goto(-350,180)
six.pendown()
for turn in range(57):
six.left(10)
#turtle seven
seven=Turtle()
seven.color('magenta')
seven.shape('turtle')
seven.penup()
seven.goto(-460,150)
seven.pendown()
for turn in range(50):
seven.right(10)
#turtle eight
eight=Turtle()
eight.color('light slate gray')
eight.shape('turtle')
eight.penup()
eight.goto(-550,110)
eight.pendown()
for turn in range(60):
eight.left(10)
#announces the winner
a= ('TODAYS WINNER IS:')
goto(0,-100) # where the winner is displayed
write(a, font=("Arial", 14, "bold"))
addk=0
addkk=0
addkkk=0
addkkkk=0
addkkkkk=0
addkkkkkk=0
addkkkkkkk=0
addkkkkkkkk=0
#================================================
# Race Code
#================================================
for turn in range(180):
turtleone=randint(1,5)
turtletwo=randint(1,5)
turtlethree=randint(1,5)
turtlefour=randint(1,5)
turtlefive=randint(1,5)
turtlesix=randint(1,5)
turtleseven=randint(1,5)
turtleeight=randint(1,5)
one.forward(turtleone)
two.forward(turtletwo)
three.forward(turtlethree)
four.forward(turtlefour)
five.forward(turtlefive)
six.forward(turtlesix)
seven.forward(turtleseven)
eight.forward(turtleeight)
# winning menu p2
addk+=turtleone
addkk+=turtletwo
addkkk+=turtlethree
addkkkk+=turtlefour
addkkkkk+=turtlefive
addkkkkkk+=turtlesix
addkkkkkkk+=turtleseven
addkkkkkkkk+=turtleeight
if addk>=500:
one.penup()
one.goto(10,-120)
break
elif addkk>=500:
two.penup()
two.goto(10,-120)
break
elif addkkk>=500:
three.penup()
three.goto(10,-120)
break
elif addkkkk>=500:
four.penup()
four.goto(10,-120)
break
elif addkkkkk>=500:
five.penup()
five.goto(10,-120)
break
elif addkkkkkk>=500:
six.penup()
six.goto(10,-120)
break
elif addkkkkkkk>=500:
seven.penup()
seven.goto(10,-120)
break
elif addkkkkkkkk>=500:
eight.penup()
eight.goto(10,-120)
break
不幸的是,我无法找到定义“语言环境”有效值的列表或表。
语言环境的另一个有效值是“ English_United States.1252”。是否有网站或R命令至少在LC_TIME会显示所有有效的语言环境值?谢谢