“OpenFiledialog Python” Code-Antworten

So öffnen Sie das Dialogfeld, um den Ordner in Python auszuwählen

>>> from tkinter import Tk, filedialog
>>>
>>> root = Tk() # pointing root to Tk() to use it as Tk() in program.
>>> root.withdraw() # Hides small tkinter window.
''
>>> root.attributes('-topmost', True) # Opened windows will be active. above all windows despite of selection.
''
>>> open_file = filedialog.askdirectory() # Returns opened path as str
>>> print(open_file) 
C:/Users/User/Music
>>> 
Action Kamen

OpenFiledialog Python

import tkinter as tk
from tkinter import filedialog

root = tk.Tk()
root.withdraw()

file_path = filedialog.askopenfilename()
S3NS4

Ähnliche Antworten wie “OpenFiledialog Python”

Fragen ähnlich wie “OpenFiledialog Python”

Weitere verwandte Antworten zu “OpenFiledialog Python” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen