我试图摆脱OptionMenu.
我将颜色更改为红色,但它周围仍然有一个白色边框。
任何人都可以帮忙吗?
from tkinter import *
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('500x500')
var = StringVar()
option = ttk.OptionMenu(root,var,'1','2','3')
option["menu"].config(bg="red")
option.pack()
root.mainloop()
Run Code Online (Sandbox Code Playgroud)
这是我第一次使用 tkinter 制作完整的 python 应用程序并想要分发它。我一直在网上搜索,但我不太清楚如何为我的应用程序制作许可证密钥,因为我想要一个唯一的密钥,我给某些人允许他们运行该应用程序,而且我也希望能够停用该密钥并创建新密钥。请注意,这是一个适用于 Windows 计算机的应用程序,提前感谢您的帮助。
嗨,如果满足 if 语句的条件(在一段时间内满足),我正在尝试销毁一个类对象
global variablecheck
class createobject:
def __init__(self,userinput):
self.userinput = input
self.method()
def method(self):
while True:
if self.userinput == variablecheck
print('the object created using this class is still alive')
else:
print('user object created using class(createobject) is dead')
#what code can i put here to delete the object of this class?
Run Code Online (Sandbox Code Playgroud)