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
Simple and fast, exact what I need!
"hey you yeah i'm talking to you".
A useful video, thanks bro.
Thanks for simple explanation
Awesome ◉‿◉. Explain good to understand. And thanks for sharing code in description. As I am new, this video is very helpful for me.
I said fantastic before I see you video Sir! Because I know your teachings❤❤❤❤
If you have errors about bad file type - use the following construction: filetypes=[("Text files", "*.txt"), ("Rulename", "file_extension")]
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()
Great short to the point tutorial. Thank you
this tutorial helped me , Thank you
thank you so much! this is exactly what I needed! subscribed
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.
BRO YOUR VIDEOS IS SO USEFUL
hi i from of venezuela, nice video
Thank you very much! you are amazing
I got it. Thank you so much !
Good information
thank you .....keep it up
great vid bro, im not a bot, just clarifying
that's what a bot would say lol
@@BroCodez 🤣🤣🤣🤣🤣
Thank you, this is helpful.
Cool Video Cheers
Thanks man, do know if a filepicker is in python?
Excelente vídeo! Me sirvió de mucho. Saludos
RuntimeError: main thread is not in main loop
Great Video
thanks for sharing the code
Thank you very much
Nice done
Very good video
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 🙂
hey bro, why didn't you type the "master" when making the open button ?
thank you so much
Thank you !!
Thank you
Wow!!!!
Awesome video, but what if i want to print it on a Textbox?
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
شكرا
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?
How did you add the open menu with tkinter sign on your pycharm menu am confused, plz help
Как же прекрасно, что здесь есть субтитры на русском. Спасибо огромное!
Как мне получить доступ к переменной filepath, не объявляя её глобальной, и не вызывая функцию
@@vladglassofficial По сути в питоне переменные это ссылки. И если создать переменную в функции, и с тем же названием вне функции. Это будут разные переменные, отвечающие за разные участки памяти (но на вид тебе будут казаться одинаковыми). Если тебе нужно чтото делать с переменной после исполнения функции, то return (возврати то что тебе нужно). Если тебе вообще не хочется использовать функцию, то создай переменную в основном коде.
Но я не совсем понимаю вопрос, т.к. не знаю зачем тебе это нужно.
Sir,
How can I open a excel sheet within the created gui window
🥰🥰🥰🥰🥰🥰
If you don't select a file and close the window. You get a FileNotFoundError
How to add this open button to submenu and open it through submenu . Plzs help 🙏
Great video!!! What if I want to upload it to SQLite
Bro how I want to write when I only need print file name and not the file path.. can u help me please..
Can Excel files works on Tkinter?
thanks bro
thank you bro
I subscribed you now
thank u
bad file type "*.txt", should be "typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?"
How we can save the image on click
thanks :)
You gotta add those nuclear launch codes to the description too...
My name is Pizza i like Bro. : )
I like the bro code. ❤
how can i put a button on this GUI that run a .py script
loveIT
How about multi files
comment to help with algorithm.
:)
bu'on bu'on
i was here
meow meow meow~!
coment
comment