READ FILES using Python! (.txt, .json, .csv) 🔍

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

Bro Code

Bro Code

Күн бұрын

Пікірлер: 17
@BroCodez
@BroCodez 6 ай бұрын
# Python reading files (.txt, .json, .csv) # ---------- .txt ---------- file_path = "C:/Users/HP/Desktop/input.txt" try: with open(file_path, 'r') as file: content = file.read() print(content) except FileNotFoundError: print("That file was not found") except PermissionError: print("You do not have permission to read that file") # ---------- .json ---------- import json file_path = "C:/Users/HP/Desktop/input.json" try: with open(file_path, 'r') as file: content = json.load(file) print(content ) except FileNotFoundError: print("That file was not found") except PermissionError: print("You do not have permission to read that file") # ---------- .csv ---------- import csv file_path = "C:/Users/HP/Desktop/input.csv" try: with open(file_path, 'r') as file: content = csv.reader(file) for line in content: print(line) except FileNotFoundError: print("That file was not found") except PermissionError: print("You do not have permission to read that file")
@sanath8854
@sanath8854 6 ай бұрын
Thanks a lot man, it helped me.
@abbymiller
@abbymiller 3 ай бұрын
BIG THANKS TO YOU
@piano_depois_dos_50
@piano_depois_dos_50 6 ай бұрын
Thank you.
@alexramos587
@alexramos587 6 ай бұрын
Very helpful. Thanks, Bro!
@mohsenmk2537
@mohsenmk2537 6 ай бұрын
Thank you Bro for beautiful content
@MarcsBianchini
@MarcsBianchini 6 ай бұрын
You can you use an 'r' in front of the absolute path and let the path unchanged. like this r"C:\User\HP\Descktop".
@Quizzes-n7l
@Quizzes-n7l 6 ай бұрын
BROCODE IM A BIG BIG FAN, I learned Css and Html from you and am currently learning React.Js. BRO AM A BIG FAN THANKS ALLOT FOR TEACHING ME
@jayasan1649
@jayasan1649 6 ай бұрын
same here bro!thank u bro code
@pizzalawl3544
@pizzalawl3544 6 ай бұрын
yo I know you haven't done C videos in a while but could you please do a tutorial on preprocessor directives?? really need a good one right now and i can't find anything good online.
@soumyadeepghosh4428
@soumyadeepghosh4428 6 ай бұрын
kotlin full course please man !
@somonorhong168
@somonorhong168 6 ай бұрын
Brooo i wanna see your C# window tutorial video
@MarianoBustos-i1f
@MarianoBustos-i1f 6 ай бұрын
Thanks Bro
@robert-qn8hy
@robert-qn8hy 6 ай бұрын
Can you please make a video on Lambda Decorators in python... 🙏
@DoomGuy911_
@DoomGuy911_ 6 ай бұрын
Came in clutch i have an exam on this tmr lol
@NazneenNaharNishi
@NazneenNaharNishi 6 ай бұрын
When you will teach us the android development bro...♥♥♥♥♥♥♥♥
@mohamedcoufi9873
@mohamedcoufi9873 6 ай бұрын
First
WRITE FILES using Python!  (.txt, .json, .csv) ✍
13:47
Bro Code
Рет қаралды 10 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
God-Tier Developer Roadmap
16:42
Fireship
Рет қаралды 7 МЛН
Python exception handling ⚠️
7:39
Bro Code
Рет қаралды 70 М.
5 Uncommon Python Features I Love
15:09
Indently
Рет қаралды 176 М.
The World Depends on 60-Year-Old Code No One Knows Anymore
9:30
Coding with Dee
Рет қаралды 1 МЛН
5 Useful Dunder Methods In Python
16:10
Indently
Рет қаралды 67 М.
This is Why Programming Is Hard For you
10:48
The Coding Sloth
Рет қаралды 1 МЛН
C++ Super Optimization: 1000X Faster
15:33
Dave's Garage
Рет қаралды 333 М.
How to NOT Fail a Technical Interview
8:26
Fireship
Рет қаралды 1,5 МЛН
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
pixegami
Рет қаралды 301 М.