High Definition Standard Definition Theater
Video id : E-fRoW9drEI
ImmersiveAmbientModecolor: #8e9a98 (color 2)
Video Format : (720p) openh264 ( https://github.com/cisco/openh264) mp4a.40.2 | 44100Hz
Audio Format: 140 ( High )
PokeEncryptID: 48d9ddeb89828fd0f420f19498a723cfc3a4bd6b5cfba4e78aa10c5218814f2b04fedac657428c73a78512747303cf39
Proxy : eu-proxy.poketube.fun - refresh the page to change the proxy location
Date : 1739148127734 - unknown on Apple WebKit
Mystery text : RS1mUm9XOWRyRUkgaSAgbG92ICB1IGV1LXByb3h5LnBva2V0dWJlLmZ1bg==
143 : true
Are you handling files WRONG in Python? #python #learnprogramming #coding #pyhton
 60 FPS video
69,694 Views • Nov 7, 2023 • Click to toggle off description
In this video, we look at three ways to handle opening, reading and writing to files in Python. It's usually best to use the WITH keyword for this, which handles exceptions for you. If you're learning to program and want more tips and tricks, make sure to subscribe for more. #programming #vscode #learnpython
Metadata And Engagement

Views : 69,694
Genre: Education
License: Standard YouTube License
Uploaded At Nov 7, 2023 ^^


warning: returnyoutubedislikes may not be accurate, this is just an estiment ehe :3
Rating : 4.381 (411/2,246 LTDR)

84.53% of the users lieked the video!!
15.47% of the users dislieked the video!!
User score: 76.80- Positive

RYD date created : 2024-05-07T16:47:22.247823Z
See in json
Connections
Nyo connections found on the description ;_; report an issue lol

46 Comments

Top Comments of this video!! :3

@alfchemy

1 year ago

I open with double click

7 |

@Hi.GuysBs

1 year ago

I never knew that finally existed in python

2 |

@knut-olaihelgesen3608

1 year ago

Actually, exception handling is better, because there is so many errors that should be handled. Checking whether a file exists is not guaranteed to work. Source: https://youtu.be/V6IX3k8PDBc?si=OPyZ_fKCmVLQH2tI

2 |

@shalevforfor5550

11 months ago

You can store data this way 👍

|

@1hindu-sthaani558

1 year ago

It is similar to try-with-resource in java

1 |

@James-l5s7k

1 year ago

Nope; best is to use pathlib.

19 |

@osoriomatucurane9511

1 year ago

Awesome tutorial covering in concise , crystal clear way the data preparation workflow. Well done Sir.
I like the concept of data sanity, garbage values and how to spot those inconstent value errors with the count_values method.
Just one point on filling the missing values. It could be worthy discussing and considering the possibility of grouping and replace with the mean for each group.
Bbrilliant work, Sir. Keep it up

6 |

@dodgywoodcock

1 year ago

What theme you use? Could you suggest?

|

@HmongCrypto

1 year ago

Wow....
I never learnt any other way except for the best way. Didn't know it was a common mistake.

|

@digitalmachine0101

1 year ago

I wanted text to word converting code

|

@petrlaskevic1948

1 year ago

You dont need to close the file, if your program ends after it writes to the file, afaik

|

@knkn5049

1 year ago

What if i write in colab, i open file in one block, and testing some functions in another, would WITH close my file when original block end?

|

@rybakostis

1 year ago

It isn't the "right" way. The right way depends on a particular use case

2 |

@knkn5049

1 year ago

I use os.pathexists thing
if not .... : return... Else :...
What With does? What it will tell me if it cant open or out of memory to create?

1 |

@Discodave676

1 year ago

Virutal files all the way

2 |

@bsw2112

1 year ago

So i assume open and close is not shown in "best" option

1 |

@member.x.from.sai-teiki

1 year ago

やっぱwith文しか勝たん😄

1 |

@and_rotate69

1 year ago

Actually each one has its own uses, for instance the last one is mainly used to do quick and simple operations on the file where the 1st one is used when u gonna work on the same file for the rest of the code, at first it will sound okay to use the last one for longer tasks, but trust me it gets bad with the indentation, the 2nd one is basically the combination between the 1st and 3rd and is an overkill lol

|

Go To Top