接收多个简单对话弹出窗口的输入

问题描述

我是编程新手,所以如果我的问题太傻了,请耐心等待,但是我还无法解决这个问题。我正在尝试使用GUI tkinter在Python中构建一个简单的“石头,剪刀”游戏。如何使用这些弹出窗口创建循环?

到目前为止,这就是我所拥有的,我如何将其转变为循环,以便游戏可以继续进行?预先感谢!

from tkinter import simpledialog

def press():

    header = simpledialog.askstring("Welcome","Please enter your name")

root = Tk()


button = Button(root,text="Let's PLAY!",command=press)

button.pack()


NEW

import random


def rock():
    pass


def paper():
    pass


def scissors():
    pass


start = ""

response = [rock,paper,scissors]
ai_response = random.choice(response)

while start != "quit":
    start = input(">>> ").lower()
    if start == "play":
  print('You are about the play "ROCK,PAPER,SCISSORS"')

 elif start == "1":
        print("""
You have chosen 1 ?! 
rookie.... """)
        if start == "paper":
            print(ai_response())

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)