Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python tkinter filedialog folder

from tkinter import filedialog

								# Where it open to.					# What the window is called.
folder = filedialog.askdirectory(initialdir=os.path.normpath("C://"), title="Example")
Comment

python tkinter filedialog

from tkinter import filedialog

						# Where it open to.					# What the window is called.	# What file types the user can choose between. first one is the defualt. (("what ever", "*.format"), ("what ever 2", "*.format2"))
filedialog.askopenfilename(initialdir=os.path.normpath("C://"), title="Example", filetypes =(("PNG", "*.png"),("JPG", "*.jpg"),("All Files","*.*")))
Comment

tkinter filedialog

from tkinter import filedialog
 
filedialog.asksaveasfilename()
filedialog.asksaveasfile()
filedialog.askopenfilename()
filedialog.askopenfile()
filedialog.askdirectory()
filedialog.askopenfilenames()
filedialog.askopenfiles()
Comment

tkinter filedialog filename

def open_file():
    file = askopenfile(mode='r', filetypes=[
                       ('Text files', '*.txt'), ('CSV Files', '*.csv')])
    if file is not None:
        print(file.name.split("/")[-1]) # this will print the file name

btn = Button(root, text='Open', command=lambda: open_file())
btn.pack(side=TOP, pady=10)
Comment

PREVIOUS NEXT
Code Example
Python :: how to update image in django 
Python :: how to use prettify function in python 
Python :: pandas change column order 
Python :: csv.dictreader 
Python :: python add 1 
Python :: tkinter filedialog filename 
Python :: List Nested Lists 
Python :: jquery datepicker disable 
Python :: indent python 
Python :: javascript or python 
Python :: django-chartjs 
Python :: what does manage.py do 
Python :: add Elements to Python list Using insert() method 
Python :: how to transcode a video in python using ffmpeg 
Python :: python printing 
Python :: python if something exception 
Python :: python anonymous object 
Python :: python suppress print output from function 
Python :: time complexity of remove in python 
Python :: pandas dataframe total column 
Python :: Reverse an string Using Reversed 
Python :: c is better than python 
Python :: EJERCICIOS DE FOR Y WHILE en python 
Python :: networkx - remove small components from a graph 
Python :: file = Root() path = file.fileDialog() print("PATH = ", path) 
Python :: sphinx, where to write the glossary of a sofware project 
Shell :: install git ec2 linux 
Shell :: check nginx status 
Shell :: install dateutil 
Shell :: purge from terminal 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =