python - Tkinter filedialog.askdirectory() 在 Windows 服务器中不起作用
问题描述
我正在使用 Tkinter 打开一个询问路径的对话框,用于此的代码是
from tkinter import filedialog
from tkinter import *
root = Tk()
root.withdraw() #Since I only need the filedialog and not a blank window at the back
source_folder = filedialog.askdirectory(title = 'Select Source Folder')
这适用于我的 Windows 安装,但是当我在 Windows 服务器上运行它时,对话框(文件夹选择框未打开)
注意Windows 服务器不会冻结,它只是不显示弹出窗口,并且 powershell 的行为就像它正在等待输入一样。
系统配置:
本地系统(工作):Python 3.6,Windows 10 N (1803)
远程系统(不工作):Python 3.6、windows Server 2016 Standard (1607)
使用 连接到远程服务器mstsc
,如果需要,我很乐意提供其他信息。
我在发布之前已经尝试过的事情:
- 重新启动 Windows 服务器。
- 在 Windows 服务器上全新安装 python。
- 多次检查我正在运行相同的代码。
- 仅在服务器上运行此独立代码。
让我知道您是否能够复制问题,如果不能,我可能必须重置 Windows 服务器安装。PS 以防万一,是的,服务器具有完整的图形界面,而不是命令行界面。
解决方案
推荐阅读
- javascript - Redux 操作打字稿返回类型不起作用
- sql - 从相当老的 IBM iseries AS400 DB2 查询数据(日期格式问题)
- python - 如何在 Pandas 上通过 group by 应用累积聚合函数?
- regex - 正则表达式(Bigquery)从 STRING 获取特定值
- django - 设置特定查询集的限制
- c# - DDD - DomainDrivenDesign 和解析日期
- vb.net - VB.NET 4.5 应用程序在 Windows 10 操作系统中的性能下降
- javascript - 多步骤表单 - 如何显示之前步骤的数据?
- angular - Angular 8:Google Maps API 对中国的支持
- angular - Angular 中的 URL 更改后组件不更新