Python GUI open a file (filedialog) 📁

  Рет қаралды 99,165

Bro Code

Bro Code

Күн бұрын

Пікірлер: 78
@BroCodez
@BroCodez 4 жыл бұрын
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()
@vladglassofficial
@vladglassofficial 3 жыл бұрын
How to print variable "filepath" outside a function?
@sportiano3348
@sportiano3348 2 жыл бұрын
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
@KhoaNguyen-bk2kv
@KhoaNguyen-bk2kv 3 жыл бұрын
"hey you yeah i'm talking to you". A useful video, thanks bro.
@EltonSenne
@EltonSenne 3 жыл бұрын
Simple and fast, exact what I need!
@yosefgreen4187
@yosefgreen4187 2 жыл бұрын
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()
@nishadshivprakash
@nishadshivprakash 3 жыл бұрын
Awesome ◉‿◉. Explain good to understand. And thanks for sharing code in description. As I am new, this video is very helpful for me.
@kingshahzad78
@kingshahzad78 Ай бұрын
I said fantastic before I see you video Sir! Because I know your teachings❤❤❤❤
@amirekhalili
@amirekhalili Жыл бұрын
Thanks for simple explanation
@digitalmachine0101
@digitalmachine0101 7 ай бұрын
Good information
@shahabkhokhar4039
@shahabkhokhar4039 2 жыл бұрын
thank you so much! this is exactly what I needed! subscribed
@vadzimfiadotsyeu2967
@vadzimfiadotsyeu2967 3 жыл бұрын
If you have errors about bad file type - use the following construction: filetypes=[("Text files", "*.txt"), ("Rulename", "file_extension")]
@Data_Falcon
@Data_Falcon 5 ай бұрын
BRO YOUR VIDEOS IS SO USEFUL
@martinrosschou
@martinrosschou 2 ай бұрын
I'm about 2 hours in to my Python learning. I removed all the button stuff, and just did openFile() instead.
@martin-xq7te
@martin-xq7te 2 жыл бұрын
Great short to the point tutorial. Thank you
@ArmandoEnriqueUrrutiaBlanco
@ArmandoEnriqueUrrutiaBlanco 3 ай бұрын
hi i from of venezuela, nice video
@paraglide01
@paraglide01 3 жыл бұрын
Thanks man, do know if a filepicker is in python?
@piotrkopcewicz5227
@piotrkopcewicz5227 Жыл бұрын
Great tutorial. Love it !!:)
@anaschafik6109
@anaschafik6109 Жыл бұрын
this tutorial helped me , Thank you
@peromiracomodudan...6876
@peromiracomodudan...6876 2 жыл бұрын
Nice done
@AniGuy-sm7iy
@AniGuy-sm7iy 2 жыл бұрын
hey bro, why didn't you type the "master" when making the open button ?
@tanphatnguyen4873
@tanphatnguyen4873 Жыл бұрын
I got it. Thank you so much !
@seifelshlkany5032
@seifelshlkany5032 2 жыл бұрын
Thank you very much! you are amazing
@exploretheuniverse1686
@exploretheuniverse1686 6 ай бұрын
thank you .....keep it up
@KumarAnalytic
@KumarAnalytic 2 жыл бұрын
Great Video
@KimPrajapati-f6d
@KimPrajapati-f6d Жыл бұрын
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 ?
@gwyne4192
@gwyne4192 Жыл бұрын
Is it possible to open multiple files and return multiple directories?
@JimmyZyzz
@JimmyZyzz 3 жыл бұрын
Excelente vídeo! Me sirvió de mucho. Saludos
@davutselamiozkahraman8200
@davutselamiozkahraman8200 Жыл бұрын
Very good video
@davidrose1999
@davidrose1999 2 жыл бұрын
Cool Video Cheers
@deepdaddy1208
@deepdaddy1208 4 жыл бұрын
great vid bro, im not a bot, just clarifying
@BroCodez
@BroCodez 4 жыл бұрын
that's what a bot would say lol
@Amir_Plays_non_stop
@Amir_Plays_non_stop 3 жыл бұрын
@@BroCodez 🤣🤣🤣🤣🤣
@tusharbhatriya3700
@tusharbhatriya3700 3 жыл бұрын
Bro if I want to show that txt or any file inside gui then what I can write?
@naturesounds1427
@naturesounds1427 3 жыл бұрын
How did you add the open menu with tkinter sign on your pycharm menu am confused, plz help
@chetanpatteparapu7600
@chetanpatteparapu7600 3 жыл бұрын
Thank you, this is helpful.
@minhct2511
@minhct2511 2 жыл бұрын
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
@Artzaint
@Artzaint 2 жыл бұрын
Awesome video, but what if i want to print it on a Textbox?
@lovebaking2503
@lovebaking2503 Жыл бұрын
thanks for sharing the code
@ГрГафф
@ГрГафф 3 жыл бұрын
Как же прекрасно, что здесь есть субтитры на русском. Спасибо огромное!
@vladglassofficial
@vladglassofficial 3 жыл бұрын
Как мне получить доступ к переменной filepath, не объявляя её глобальной, и не вызывая функцию
@ГрГафф
@ГрГафф 3 жыл бұрын
@@vladglassofficial По сути в питоне переменные это ссылки. И если создать переменную в функции, и с тем же названием вне функции. Это будут разные переменные, отвечающие за разные участки памяти (но на вид тебе будут казаться одинаковыми). Если тебе нужно чтото делать с переменной после исполнения функции, то return (возврати то что тебе нужно). Если тебе вообще не хочется использовать функцию, то создай переменную в основном коде. Но я не совсем понимаю вопрос, т.к. не знаю зачем тебе это нужно.
@EissaAlahdul
@EissaAlahdul 2 жыл бұрын
شكرا
@mohamedtaki8748
@mohamedtaki8748 3 жыл бұрын
Thank you very much
@personanongrata2339
@personanongrata2339 Жыл бұрын
thank you so much
@sonalivishwakarma9351
@sonalivishwakarma9351 2 жыл бұрын
Thank you 🙂
@dwithidaya4168
@dwithidaya4168 3 жыл бұрын
Sir, How can I open a excel sheet within the created gui window
@imamsantoso7994
@imamsantoso7994 4 ай бұрын
Thank you
@bjh5878
@bjh5878 3 жыл бұрын
Thank you !!
@wakkendul1434
@wakkendul1434 3 жыл бұрын
Bro how I want to write when I only need print file name and not the file path.. can u help me please..
@KenDedes94
@KenDedes94 3 жыл бұрын
Can Excel files works on Tkinter?
@riyapalkar1178
@riyapalkar1178 3 жыл бұрын
How to add this open button to submenu and open it through submenu . Plzs help 🙏
@beingzero7541
@beingzero7541 2 жыл бұрын
Wow!!!!
@rolfjohansen5376
@rolfjohansen5376 Жыл бұрын
RuntimeError: main thread is not in main loop
@mohitjain1804
@mohitjain1804 2 жыл бұрын
How we can save the image on click
@منوعاتمنوعات-ح1غ
@منوعاتمنوعات-ح1غ Жыл бұрын
🥰🥰🥰🥰🥰🥰
@KumarAnalytic
@KumarAnalytic 2 жыл бұрын
I subscribed you now
@joelkafesu6757
@joelkafesu6757 3 жыл бұрын
how can i put a button on this GUI that run a .py script
@akashaabeysundara8454
@akashaabeysundara8454 6 ай бұрын
thanks bro
@hydarhydar2338
@hydarhydar2338 17 күн бұрын
I like the bro code. ❤
@maxsuspochtam1489
@maxsuspochtam1489 8 ай бұрын
thank u
@loiczeq5551
@loiczeq5551 2 жыл бұрын
thanks :)
@abdoularbi5718
@abdoularbi5718 3 жыл бұрын
thank you bro
@umartahir2043
@umartahir2043 3 жыл бұрын
Great video!!! What if I want to upload it to SQLite
@KEVINSURIEL
@KEVINSURIEL 7 ай бұрын
How about multi files
@philtoa334
@philtoa334 3 жыл бұрын
My name is Pizza i like Bro. : )
@jeremy_ching
@jeremy_ching 2 жыл бұрын
bu'on bu'on
@jhassee
@jhassee Жыл бұрын
loveIT
@AniruddhaGA
@AniruddhaGA 3 жыл бұрын
bad file type "*.txt", should be "typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?"
@hasansolak23
@hasansolak23 3 жыл бұрын
You gotta add those nuclear launch codes to the description too...
@bigdeallo
@bigdeallo Жыл бұрын
If you don't select a file and close the window. You get a FileNotFoundError
@duyoan6821
@duyoan6821 Жыл бұрын
i was here
@gustavoaponte1814
@gustavoaponte1814 Жыл бұрын
meow meow meow~!
@aneverdayhobbiest2837
@aneverdayhobbiest2837 9 ай бұрын
comment to help with algorithm.
@promax1st
@promax1st 2 жыл бұрын
:)
@seu_policial9463
@seu_policial9463 6 ай бұрын
coment
@arpanshah355
@arpanshah355 Жыл бұрын
comment
Python GUI save a file (filedialog) 💾
10:26
Bro Code
Рет қаралды 43 М.
Open Files Dialog Box - Python Tkinter GUI Tutorial #15
12:34
Codemy.com
Рет қаралды 193 М.
SISTER EXPOSED MY MAGIC @Whoispelagheya
00:45
MasomkaMagic
Рет қаралды 12 МЛН
1 сквиш тебе или 2 другому? 😌 #шортс #виола
00:36
Ouch.. 🤕⚽️
00:25
Celine Dept
Рет қаралды 15 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 262 #shorts
00:20
5 Good Python Habits
17:35
Indently
Рет қаралды 571 М.
Using tkinter with classes
28:23
Atlas
Рет қаралды 68 М.
Python Tutorial: File Objects - Reading and Writing to Files
24:33
Corey Schafer
Рет қаралды 1,8 МЛН
Convert GUI App to Real Program -  Python to exe to setup wizard
23:27
Python Simplified
Рет қаралды 533 М.
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,6 МЛН
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 408 М.
Use a Drag & Drop Editor to Make Tkinter Python GUI Applications!
11:16
Convert Tkinter Python App to Executable (.Exe) File [pyinstaller]
9:11
Code First with Hala
Рет қаралды 153 М.
Tkinter Beginner Course - Python GUI Development
38:59
NeuralNine
Рет қаралды 544 М.
SISTER EXPOSED MY MAGIC @Whoispelagheya
00:45
MasomkaMagic
Рет қаралды 12 МЛН