Apr-28-2020, 07:31 PM
import random
import time
import sys
from turtle import *
from turtle import textinput
setup()
t1= Turtle()
t1.left(180)
t1.penup()
t1.forward(200)
#Create the list of possible shots
lista = [ 'push drive', 'push back', 'long push drive', 'long push back', 'top spin drive', 'top spin back', 'open up drive', 'open up back' , 'flip drive', 'flip back']
#input data
#count = int(input("How many random numbers do you want to generate? "))
#segundos = int( input ("segundos de espera?: "))
count=int(t1.textinput("Repeticiones", "Repeticiones: "))
Segundos=int(t1.textinput("Intervalo", "Segundos: "))
t1.write("COMENZAMOS.....", font=("arial",40, "normal"))
time.sleep(5)
#Iterate
rmax = len (lista) - 1
for r in range(count):
time.sleep(segundos)
num=random.randint(1, rmax)
t1.clear()
t1.write(lista [num].upper(), font=("arial",40, "normal"))
Error message
Traceback (most recent call last):
File "/Users/fgm/Downloads/Random Numbers.py", line 16, in <module>
count=int(t1.textinput("Repeticiones", "Repeticiones: "))
AttributeError: 'Turtle' object has no attribute 'textinput'
Running dir([turtle]) gives all the methods and they are not on the list
import time
import sys
from turtle import *
from turtle import textinput
setup()
t1= Turtle()
t1.left(180)
t1.penup()
t1.forward(200)
#Create the list of possible shots
lista = [ 'push drive', 'push back', 'long push drive', 'long push back', 'top spin drive', 'top spin back', 'open up drive', 'open up back' , 'flip drive', 'flip back']
#input data
#count = int(input("How many random numbers do you want to generate? "))
#segundos = int( input ("segundos de espera?: "))
count=int(t1.textinput("Repeticiones", "Repeticiones: "))
Segundos=int(t1.textinput("Intervalo", "Segundos: "))
t1.write("COMENZAMOS.....", font=("arial",40, "normal"))
time.sleep(5)
#Iterate
rmax = len (lista) - 1
for r in range(count):
time.sleep(segundos)
num=random.randint(1, rmax)
t1.clear()
t1.write(lista [num].upper(), font=("arial",40, "normal"))
Error message
Traceback (most recent call last):
File "/Users/fgm/Downloads/Random Numbers.py", line 16, in <module>
count=int(t1.textinput("Repeticiones", "Repeticiones: "))
AttributeError: 'Turtle' object has no attribute 'textinput'
Running dir([turtle]) gives all the methods and they are not on the list