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