Мой код застревает в конце функции подготовить_для_ответа. Есть ли что-то действительно очевидное, что мне не хватает?Python

Программы на Python
Ответить
Anonymous
 Мой код застревает в конце функции подготовить_для_ответа. Есть ли что-то действительно очевидное, что мне не хватает?

Сообщение Anonymous »

Код: Выделить всё

from turtle import *
import random
import time

#making the main 8-ball
def main_8_ball():
#used to be the main drawing, not needed
write("8", font=('Arial',24,'normal'))
turtle_prepare_for_answer()

def main_logic(): #Taken from the magic 8 ball assignment in Q2

useless_input=textinput("Turtle Vision","Ask a question to explore the depths of the future. Press 'esc' to quit: ")
output_int=random.randint(0,19)
#print(output_int) #for test reasons
if useless_input=="stop":
quit()
#useless decision-making stuff

def turtle_prepare_for_answer():
right(180)
fd(200)
write(main_logic())
time.sleep(10)
reset() #gets stuck here, doesn't run the question again
main_8_ball()

loop_setter=1
while loop_setter==1:
main_8_ball()

#user can see output until program is killed manually. also nice for testing the turtle
done()

Как я уже говорил выше, код зависает на втором этапе. Не обращайте внимания на графику, все равно WiP, но я понятия не имею, что здесь не так. Есть идеи?

Подробнее здесь: https://stackoverflow.com/questions/798 ... here-somet
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Python»