小编Jea*_*dou的帖子

Python 3如何暂时禁用跟踪变量

我在Windows上使用Python 3.4.1,如果这应该有帮助.

Q1:我如何暂时禁用跟踪变量 我有一个跟踪的变量字段,我想暂时禁用跟踪,以便我可以更改字段的值而不触发对跟踪功能的调用.

是否有意义?

可能是我做错了(我加入了一段代码):

我有一个下拉列表,显示了我可以选择的项目列表.我有第二个下拉列表,为第一个下拉菜单中的每个项目显示"子项目"列表,当我更改第一个下拉菜单时,当然必须更新这些项目.

Q2:问题是,当第一个下拉菜单发生变化时,如何"重新包装"第二个下拉菜单?

这是代码:

import tkinter as tk

WORKINGWINDOWWIDTH  = 800                         # Width for the working window
WORKINGWINDOWHEIGHT = 800                         # Height for the working window

root = tk.Tk()

w = tk.Canvas(root, width=WORKINGWINDOWWIDTH - 10, height=WORKINGWINDOWHEIGHT - 10, bg="darkred")

def display_parameters(*args):
    print("args: {0}, and I have the following option: {1}".format(args, functionChoiceVar.get()))
    if functionChoiceVar.get() == "Option 1":
        print("I picked the first one...")
        print("How do I repack the presets?")
    elif functionChoiceVar.get() == "Option 2":
        print("I …
Run Code Online (Sandbox Code Playgroud)

python tkinter

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

标签 统计

python ×1

tkinter ×1