我如何在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?
#-*- 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) 我有这样的代码,
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,但我有相同的结果:(