what I like most is that you put the snippet code just in the description, thanks! // a better easy solution to open file from dialog and close it after choosing the file: from tkinter import * from tkinter.filedialog import askopenfilename root = Tk() root.withdraw() file_path = askopenfilename() root.destroy()
Hello Sir, How to make a copy paste file when i make file name textbox then search file in network drive path and paste user destination path to set how to do this ?
@@vladglassofficial По сути в питоне переменные это ссылки. И если создать переменную в функции, и с тем же названием вне функции. Это будут разные переменные, отвечающие за разные участки памяти (но на вид тебе будут казаться одинаковыми). Если тебе нужно чтото делать с переменной после исполнения функции, то return (возврати то что тебе нужно). Если тебе вообще не хочется использовать функцию, то создай переменную в основном коде. Но я не совсем понимаю вопрос, т.к. не знаю зачем тебе это нужно.
from tkinter import *
from tkinter import filedialog
def openFile():
filepath = filedialog.askopenfilename(initialdir="C:\\Users\\Cakow\\PycharmProjects\\Main",
title="Open file okay?",
filetypes= (("text files","*.txt"),
("all files","*.*")))
file = open(filepath,'r')
print(file.read())
file.close()
window = Tk()
button = Button(text="Open",command=openFile)
button.pack()
window.mainloop()
How to print variable "filepath" outside a function?
but i want create text editor and i want to from the user open file.txt to show on text editor ?
any way to this
If you have errors about bad file type - use the following construction: filetypes=[("Text files", "*.txt"), ("Rulename", "file_extension")]
Simple and fast, exact what I need!
"hey you yeah i'm talking to you".
A useful video, thanks bro.
Awesome ◉‿◉. Explain good to understand. And thanks for sharing code in description. As I am new, this video is very helpful for me.
what I like most is that you put the snippet code just in the description, thanks!
// a better easy solution to open file from dialog and close it after choosing the file:
from tkinter import *
from tkinter.filedialog import askopenfilename
root = Tk()
root.withdraw()
file_path = askopenfilename()
root.destroy()
I said fantastic before I see you video Sir! Because I know your teachings❤❤❤❤
Thanks for simple explanation
thank you so much! this is exactly what I needed! subscribed
BRO YOUR VIDEOS IS SO USEFUL
Great short to the point tutorial. Thank you
hi i from of venezuela, nice video
Great tutorial. Love it !!:)
I'm about 2 hours in to my Python learning.
I removed all the button stuff, and just did openFile() instead.
great vid bro, im not a bot, just clarifying
that's what a bot would say lol
@@BroCodez 🤣🤣🤣🤣🤣
this tutorial helped me , Thank you
I got it. Thank you so much !
Cool Video Cheers
Thank you very much! you are amazing
thank you .....keep it up
Good information
Excelente vídeo! Me sirvió de mucho. Saludos
Thank you, this is helpful.
Great Video
Thanks man, do know if a filepicker is in python?
Nice done
thanks for sharing the code
شكرا
thank you so much
hey bro, why didn't you type the "master" when making the open button ?
Very good video
Awesome video, but what if i want to print it on a Textbox?
Thank you
Hello Sir,
How to make a copy paste file when i make file name textbox then search file in network drive path and paste user destination path to set how to do this ?
Thank you 🙂
Thank you very much
Thank you !!
Is it possible to open multiple files and return multiple directories?
Bro if I want to show that txt or any file inside gui then what I can write?
Can you pls show me what I have to do if I want to show the text in the black window when I opened file
🥰🥰🥰🥰🥰🥰
How did you add the open menu with tkinter sign on your pycharm menu am confused, plz help
Как же прекрасно, что здесь есть субтитры на русском. Спасибо огромное!
Как мне получить доступ к переменной filepath, не объявляя её глобальной, и не вызывая функцию
@@vladglassofficial По сути в питоне переменные это ссылки. И если создать переменную в функции, и с тем же названием вне функции. Это будут разные переменные, отвечающие за разные участки памяти (но на вид тебе будут казаться одинаковыми). Если тебе нужно чтото делать с переменной после исполнения функции, то return (возврати то что тебе нужно). Если тебе вообще не хочется использовать функцию, то создай переменную в основном коде.
Но я не совсем понимаю вопрос, т.к. не знаю зачем тебе это нужно.
Wow!!!!
Sir,
How can I open a excel sheet within the created gui window
RuntimeError: main thread is not in main loop
Bro how I want to write when I only need print file name and not the file path.. can u help me please..
Great video!!! What if I want to upload it to SQLite
thanks bro
bad file type "*.txt", should be "typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?"
Can Excel files works on Tkinter?
I subscribed you now
thank u
thanks :)
I like the bro code. ❤
thank you bro
You gotta add those nuclear launch codes to the description too...
How to add this open button to submenu and open it through submenu . Plzs help 🙏
How we can save the image on click
loveIT
My name is Pizza i like Bro. : )
How about multi files
how can i put a button on this GUI that run a .py script
If you don't select a file and close the window. You get a FileNotFoundError
bu'on bu'on
comment to help with algorithm.
i was here
meow meow meow~!
:)
comment
coment