Python Turtle onkeypress() and onkeyrelease()
I don't know much about Python or coding in general, so this could just be some ignorance on my part. Disclaimer out of the way, I cant seem to use the functions above. I just get an error saying it has no attribute 'onkeypress()'. Is it not supported or something? Is this normal? Am I just a complete moron and forgot to put some crucial line for setup? Please let me know, Thanks.
Try this:
screen=turtle.Screen()
create screen turtleturtle.setheading(90)
def up():
create function for onkeyturtle.forward(40)
while True:
screen.onkey(up,"Up")
screen.onkey(function,key)