小编Eme*_*lan的帖子

在Tkinter中,我如何禁用Entry?

我如何在Tkinter中禁用Entry.

def com():
       ....

entryy=Entry()
entryy.pack()

button=Button(text="Enter!", command=com, font=(24))
button.pack(expand="yes", anchor="center")
Run Code Online (Sandbox Code Playgroud)

正如我所说,如何在com函数中禁用Entry?

python tkinter python-3.x

6
推荐指数
1
解决办法
2万
查看次数

TypeError:只能将元组(不是“str”)连接到Python中的元组

#-*- coding: cp857 -*-

from tkinter import *

###########################################################

root=Tk()

root.title("MY FILM ARCHIVE")

root.resizable(False, False)

########################################################### 


def add():
    db = open(r"C:\Users\PC\Desktop\db.txt", "a+")
    enter=input("Enter your's film: "),
    db.write(enter + "\n")
    db.close()
    db.flush()    

button=Button(text="Add Film!",command=add, font=("Flux",15, "bold"))
button.pack(expand="yes", anchor="center")

mainloop()
Run Code Online (Sandbox Code Playgroud)

当我运行该程序并按下按钮时,出现以下错误:(

TypeError: can only concatenate tuple (not "str") to tuple
Run Code Online (Sandbox Code Playgroud)

python tkinter python-3.x

2
推荐指数
1
解决办法
6498
查看次数

我的Python 3x代码有什么问题?

我有这样的代码,

database = open("C:\\Users\\PC\\Desktop\\database.txt", "w")
enter=input("What is your name: ")
database.write(enter)
database.close
Run Code Online (Sandbox Code Playgroud)

当我运行这个程序时,它不会在database.txt中打印任何内容

我尝试使用IDLE和PyScripter,但我有相同的结果:(

python python-3.x

1
推荐指数
1
解决办法
72
查看次数

标签 统计

python ×3

python-3.x ×3

tkinter ×2