Python File Handling | Working with File Objects | Read&Write to a File

preview_player
Показать описание
Python File Objects
#Python

👍Welcome to my Python Intermediate videos Series

Working with files could be extremely important to maintain some information you want to store after executing certain Python Projects, and so it could be important to be aware of how to read&write to files.

So today, we are going to learn deeply how to work with files, Writing and reading them, adding text to existing files, and more!

Connect with me with:

👍 Subscribe for more Python tutorials like this:
🔥 Comment below other topics you want to see tutorials next on my Channel.
-----------------------------------------------

My website:

The GitHub Repository for all the files I worked on throughout this tutorial:

Great documentation regarding Python File Objects:

Timeline for the video:
00:00 - 03:26 - Interact with Files & File Permission Levels
03:27 - 07:12 - The best practice to work with files (Context Managers)
07:13 - 08:22 - File objects Properties
08:23 - 12:26 - Read a file line by line
12:27 - 15:35 - Read a file by some amount of characters
15:35 - 19:10 - Read Multiple files at once
19:11 - 20:47 - Writing to a new file
20:47 - 25:52 - Adding text to an existing file
Рекомендации по теме
Комментарии
Автор

Hi, your OOP tutorial is the best tutorial ever made regarding OOP. I am only into first 4 minutes of this topic and I can already feel that this is going to be another mind blowing tutorial. You have a special skill for explaining stuff. Thank you 🙏

priteshugrankar
Автор

Hello people, in this video we have a lot of topics to cover regarding how to read and write to files, and also I have an exercise
you can go and try out by yourself to feel more comfortable with the syntax
of reading/writing/appending to a file, and you can access it from my website (Link in Description).

I hope you'll enjoy this video :)

jimshapedcoding
Автор

learned a lot! going to watch ALL your videos starting from the very first one to learn even more!!!

xilllllix
Автор

I just discovered your channel and Glad that I did, thanks for your hard work

Lilina
Автор

the best channel to learn python, Thanks Jim <3

RahulThiruthinmelPremnavas
Автор

Thank you for very valuable content explained excellently.

chessketeer
Автор

with open("./test.txt", "r") as f:
content = f.readlines()
for line in content:
print(line, end="")

import os

files = os.listdir(os.curdir)
for file in files:
if file.endswith('.txt'):
with open(file) as f:
print(f.read(), end="")

kvelez