簡體   English   中英

文件對話框未顯示在頂部窗口中

[英]filedialog doesn't show up the window on top

我正在嘗試使用Tkinter從GUI獲取文件名。 下面是代碼,我在Windows上使用Spyder / Anaconda。 該對話框未顯示在任務欄中,並且僅當我最小化spyder窗口時才可見。 有什么辦法解決這個問題?

import tkinter, tkinter.filedialog
root = tkinter.Tk()
root.withdraw()
file_path = tkinter.filedialog.askopenfilename(parent=root,title='Pick a file')    
import tkinter as tk
from tkinter import filedialog
root = tk.Tk()
root.withdraw()
file_path = filedialog.askopenfilename(parent=root)
root.destroy()

這可行。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM