Загрузка страницы

How to Read and Write Files in Python | File Handling Tutorial in Python

This is a tutorial video on how to read and write files in Python. This video covers all the basic concepts required to get started with file handling in Python. File objects in Python can be used to read the contents of a file and also file objects can be used to write or append data into a file.

In this video, we cover all the basic concepts required to get started with handing files in Python. We first look at how to read a file which is stored in our operating system. And then cover the concepts of how to write data into a file and also how to append data into a file.
We check out the different between using write and append in Python.

To open the file, we use context manager as well as the traditional method to open a file. We talk about the advantages of using context manager while opening a file in python and also explain why it is recommended in python to always use context manager when dealing with files.

Timestamps:
00:00 How to Read and Write Files in Python
00:39 How to Read a file in Python
02:55 How to use Context Manager to open a file in Python
07:16 How to Write a file in Python
09:09 How to Append a file in Python
10:20 Program to read a file and append data to another file
13:17 How to access files in different path in Python

In this video, we also talk about to how to read a file which is present in different paths or directories. By providing absolute path or relative path to the file we can tell python to look for the desired file in that specific location. However, we can also change the current working directory to point at the path where our desired file is placed.
If path is not mentioned, then Python always looks for the file in the current working directory. However, we can change the current working directory so as to point it to the location where our desired file is placed.
Alternatively, we can also provide the directory path of the file which we are trying to read. We can specify a path in two ways, one is by specifying the absolute path and second is by specifying the relative path.
In this video, we talk about relative and absolute path and also show how you can extract the current working directory and also how you can change the current working directory.

Hope you learnt something from this video. If yes, then please make sure to like and share the video with friends and colleagues who may be interested in learning about files in python.
Also, please do not hesitate to leave a comment if you have any questions related this topic. I would truly appreciate your feedback on this video in the comments section.
Finally, it would really help if you can subscribe to the channel and stay tuned for more useful video’s.

I hope this video was helpful and gives you a good understanding of regular expressions in python. If you liked what you saw, then please make sure to like, subscribe and comment any feedback you may have.
Also please do not hesitate to share the video with your friends and colleagues who may be interested in learning regular expression in python.

🔴 WATCH MORE VIDEOS HERE 👇

✅ SQL Tutorial - Basic concepts:
https://www.youtube.com/playlist?list=PLavw5C92dz9HQQ_COgGb7kf_1H8UWUBxO

✅ SQL Tutorial - Intermediate concepts:
https://www.youtube.com/playlist?list=PLavw5C92dz9FD9XspliRM_HZM_jK7tkii

✅ SQL Tutorial - Advance concepts:
https://www.youtube.com/playlist?list=PLavw5C92dz9GbmgiW4TWVnxhjMFOIf0Q7

✅ Practice Solving Basic SQL Queries:
https://www.youtube.com/playlist?list=PLavw5C92dz9F66P3GFo5O6nJ4DfZNhVsp

✅ Practice Solving Intermediate SQL Queries:
https://www.youtube.com/playlist?list=PLavw5C92dz9EIYmNXJ8ZtQ1bmLIpt0SpV

✅ Practice Solving Complex SQL Queries:
https://www.youtube.com/playlist?list=PLavw5C92dz9Fahr7taauUx5RnTfuGyL--

✅ Data Analytics Career guidance:
https://www.youtube.com/playlist?list=PLavw5C92dz9FDsr995DjwCy9XNaIukb8P

✅ SQL Course, SQL Training Platform Recommendations:
https://www.youtube.com/playlist?list=PLavw5C92dz9GqF1Q_zn8KnYvFgtEOh-2n

✅ Python Tutorial:
https://www.youtube.com/playlist?list=PLavw5C92dz9FePZXIo4jpsupqp3X0w2SW

✅ Git and GitHub Tutorial:
https://www.youtube.com/playlist?list=PLavw5C92dz9EI1MPlqqDpe3bgr8RJZE0b

✅ Data Analytics Projects:
https://www.youtube.com/playlist?list=PLavw5C92dz9HwT_uStsDdJbuBOt_XD0ch

THANK YOU,
Thoufiq

Видео How to Read and Write Files in Python | File Handling Tutorial in Python канала techTFQ
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
5 мая 2021 г. 17:29:03
00:19:30
Другие видео канала
Python Bootcamp for Beginners | Python Course | Live TrainingPython Bootcamp for Beginners | Python Course | Live TrainingWHILE loop and FOR loop in Python | LOOP statements in Python | Python Tutorial for Beginners #4WHILE loop and FOR loop in Python | LOOP statements in Python | Python Tutorial for Beginners #4What is a FUNCTION in Python | Python Functions | Python Tutorial for Beginners #6What is a FUNCTION in Python | Python Functions | Python Tutorial for Beginners #6Dictionary in Python (for beginners) | Python Dictionaries | Python Tutorial #10Dictionary in Python (for beginners) | Python Dictionaries | Python Tutorial #10What is Data Science (for beginners) | Data Science for Beginners | Data Science Life CycleWhat is Data Science (for beginners) | Data Science for Beginners | Data Science Life CycleAuto Repair - SQL Interview Query 10 | SQL Problem Level "HARD"Auto Repair - SQL Interview Query 10 | SQL Problem Level "HARD"IPL Winning Streak - SQL Interview Query 22 | SQL Problem Level "HARD"IPL Winning Streak - SQL Interview Query 22 | SQL Problem Level "HARD"Count Employees - SQL Interview Query 13 | SQL Problem Level "EASY"Count Employees - SQL Interview Query 13 | SQL Problem Level "EASY"Thank you for 1000 subscribers | Channel update | Who am i? & What i do?Thank you for 1000 subscribers | Channel update | Who am i? & What i do?Employee Attendance - SQL Interview Query 18 | SQL Problem Level "MEDIUM"Employee Attendance - SQL Interview Query 18 | SQL Problem Level "MEDIUM"Super Interesting SQL Problem | Practice SQL QueriesSuper Interesting SQL Problem | Practice SQL QueriesSQL Project | SQL Case Study to SOLVE and PRACTICE SQL Queries | 20+ SQL ProblemsSQL Project | SQL Case Study to SOLVE and PRACTICE SQL Queries | 20+ SQL ProblemsMerge Products - SQL Interview Query 9 | SQL Problem Level "EASY"Merge Products - SQL Interview Query 9 | SQL Problem Level "EASY"STEP by STEP guide to Learn Python | How to learn PYTHONSTEP by STEP guide to Learn Python | How to learn PYTHONData Analyst Interview Problem - SQL Interview Query 25 | SQL Problem Level "EASY"Data Analyst Interview Problem - SQL Interview Query 25 | SQL Problem Level "EASY"SQL Interview Problem asked by Product Based Company | Solving SQL Interview QuerySQL Interview Problem asked by Product Based Company | Solving SQL Interview QuerySplit Hierarchy - SQL Interview Query 12 | SQL Problem Level "HARD"Split Hierarchy - SQL Interview Query 12 | SQL Problem Level "HARD"Find Missing Data - SQL Interview Query 14 | SQL Problem Level "MEDIUM"Find Missing Data - SQL Interview Query 14 | SQL Problem Level "MEDIUM"Job Interview Tips | Follow these steps to clear JOB INTERVIEWS | How to clear Job Interviews?Job Interview Tips | Follow these steps to clear JOB INTERVIEWS | How to clear Job Interviews?FREE Pizzas - SQL Interview Query 19 | SQL Problem Level "MEDIUM"FREE Pizzas - SQL Interview Query 19 | SQL Problem Level "MEDIUM"Solving an INTERMEDIATE SQL Interview Query - 29 | #30DaySQLQueryChallengeSolving an INTERMEDIATE SQL Interview Query - 29 | #30DaySQLQueryChallenge
Яндекс.Метрика