用户输入崩溃导入GUI

2024-10-03 04:32:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图提示用户输入他们的名字,这样它就可以显示在我为Uni构建的程序的GUI中,问题是ttt = ...在不崩溃的情况下不会接受除引号中的字符串以外的任何内容

我的代码如下所示:

import tic_tac_toe_gui
import tkinter
# The object of the TicTacToeGUI class
# that renders the GUI.
# You can use this object to access the
# methods listed in the specification.

display_details() #displays author's details

name = input("Please enter your name here: ")
ttt = tic_tac_toe_gui.TicTacToeGUI(name) #defining GUI title bar

根据我的理解,它应该接受输入,将字符串分配给变量,从而允许用户输入显示在GUI中

注意:无法编辑GUI,因为它是由导师构建的

如果您想查看GUI代码,请告诉我


Tags: the字符串代码用户nameimportobjectgui