Тэги:
#python #tkinter #gui #python_tkinter #tkinter_python #python_gui #tkinter_gui #gui_python #graphical_user_interfaces_python #tkinter_grid_system #grid_system_tkinter #python_grid_system #build_graphical_user_interfaces_with_python #how_to_build_graphical_user_interfaces_with_python #how_to_python_tkinter #open_file_dialog_pythonКомментарии:
Great tutorial. I take it the filedialog just calls the OS's dialog box (which in linux on a chromebook is very lame)
ОтветитьThanks Sir I'm Your Student From Pakistan ❤i Subscribe Your Channel and Always Watching Your Videos , I Can't Afford ur Paid Courses On Web So I'm Wathcing u on YT
ОтветитьStraight to the problem, I love it
ОтветитьSir I added a file dialogue on a top-level but it does not show on the top but file dialogue shows under the top-level how can I fix this sir
ОтветитьLoved every minute of it!
ОтветитьHello, i would like to make a question. When you open the file you want, how can you make the button disappear from the "new" window that show the photo? Thanks in advance...
ОтветитьPerfect I need this one for my app! Thanks again 4 hours in lol
ОтветитьI was realizing that you need to use "from tkinter import filedialog" to make this script work... But I thought that "from tkinter import *" meant that it was already importing everything... Can somebody explain?
ОтветитьHello John,
I just payed the insanely low price for total membership :)
im not clear with a import thing. First we do from tkinter import * it should import everything right? yet we specifically write from tkinter import filedialog, why?
ОтветитьFantastic tutorial thank you
ОтветитьThanks for the great videos! Would be very grateful if you could answer a quick question?
What is the reason for assigning the file path string to 'root.filename'? From what I understand, this creates a new attribute called 'filename' for the 'root' object. What is the advantage of doing this instead of just assigning it to a normal variable (ie. just 'filename')?
Im a beginner. Your vides are very helpful and resourceful for learning I tried this, but Im getting an error while assigning it to label.image
player=ImageTk.PhotoImage(Image.open(main.file_name))
player_pic=Label(main,image=main.file_name)
_tkinter.TclError: image "C:/Users/PD/messi.png" doesn't exist.
Can you please help me in this
You have the best channel on the internet. The way you teach is unprecedented the scope of these projects make students want to learn the boring theory in textbooks because its being applied in real time w/ real world application. Thank you.
Ответить2022
ОтветитьThat photo with your dog is literally the brand image of the playlist, gotta love how cute your dog is!!
ОтветитьMAN I LOVE U SO MUCH
ОтветитьThanks alot
ОтветитьIs there a way to ask for file directory rather than a file, my program freezes when I try askdirectory()
ОтветитьExcellent...! pls can this be done using grid() method ?
ОтветитьThanks. I really enjoy this and find this super helpful.
ОтветитьFYI : the Scale command argument will pass the scale value to the function called. Which means you could use something like this here :
def slide(val):
root.geometry(str(val)+'x400')
Thank you very much! that helped me!
ОтветитьWhy does the message pop up as '<io.TestIOWrapper name='xxx' mode='r' encoding='cp936'> after running my_label? Would you please help me to solve this problem?
ОтветитьI don’t know why but my filter ain’t working. All the filetypes I give are applied automatically and then I cannot select any filetype.
They automatically apply all types.
Thank you so much, you saved my day <3
Ответитьthank you Heisenberg :)
ОтветитьI thought "from module import *" already imports everything there is in the module?
Why do we have to do from tkinter import textdialog after?
You've just save a life 😉
ОтветитьBest tutorial I have ever seen ❤
ОтветитьI had no idea about filedialogs before this video, WOW. I have just been manually iterating through folders this entire time :( best video by far.
ОтветитьThanks for your videos
ОтветитьThanks sir! you just saved my day
ОтветитьI'm on Mac and it is not working it is grayed out
Ответитьcan we open a excel files??
ОтветитьHow come when I run this no button appears in the window?
ОтветитьSir this is my code(
from tkinter import *
from PIL import ImageTk,Image
from tkinter import filedialog
root = Tk()
root.title("Upload Image")
def open():
global my_image
root.filename = filedialog.askopenfilename(initialdir="/",title="Select A File", filetype=(("png files", "*.png"),("jpeg files", "*.jpg"),("jpng files", "*.jpng")))
my_label = Label(root,text=root.filename).pack()
my_image = ImageTk.PhotoImage(Image.open(root.filename))
my_image_label = Label(image=my_image).pack()
Button(root,text="Upload Image",command=open).pack()
root.mainloop()
)
two button should be display Open and cancel if i will not select any image and press Cancel button then this error should be display kindly solve this error.( fp = io.BytesIO(fp.read())
AttributeError: 'str' object has no attribute 'read')
Pls anyone reply...how can i return the file path to a Entry box or feature or whatever u called....is it doable or we can only return it to a Label?
ОтветитьI need some help, when I try to open multiple images, some of them are just blank. What is the reason for this? Is there a way to fix this?
ОтветитьHow to open a folder in file dialog instead of "All Files"
ОтветитьGreat! Really Helpful
ОтветитьHello, what if now i wanna open multiple images and show them all? If i choose all files, the FileName = filedialog.askopenfilename will become a list?
Ответитьwill no one mention the fact that aspen is so cute!
ОтветитьI can't open mp4 files using this. is there any other way to do it?
ОтветитьThanku Sooo much . For this
I hadn't seen this video
Sorry . For that
But a big thanku this video helped me solve my problem 😊