微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决接收多个简单对话弹出窗口的输入

我是编程新手,所以如果我的问题太傻了,请耐心等待,但是我还无法解决这个问题。我正在尝试使用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 举报,一经查实,本站将立刻删除。