小编Paz*_*156的帖子

在 Mac 上的 Python 中使用 askopenfilename

我有点麻烦。当我使用 askopenfilename 时,它​​在 Windows 和 Linux 上运行良好,但 Mac 似乎在给我指点迷津....

下面是一个例子:

... (Code before all this)
def openFile(self):
    self.fileName = askopenfilename(filetypes=[("All Files", "*.*")])

... (Code after all this)
Run Code Online (Sandbox Code Playgroud)

问题是,当我单击我拥有的打开按钮时,会调用此方法,即使在 Mac 上也可以打开对话框,但对话框中的所有内容都变灰,并且不会让我选择任何文件。为什么不?我该如何解决这个问题?

python macos tk-toolkit tkinter

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

标签 统计

macos ×1

python ×1

tk-toolkit ×1

tkinter ×1