Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从变量中插入文本,以便如果该行已在 tkinter 中使用,则变量中的每个项目都打印到新行上?
我的代码是
variable = list.get(0, END) item = Label(root, text = variable) item.pack()
我目前的结果是: 当前
我希望它看起来如何: 需要
variable是一个字符串元组,所以用来string.join()将这些字符串连接成一个字符串:
variable
string.join()
item = Label(root, text='\n'.join(variable))