Toptube Video Search Engine



Title:How to Read and Write Files in Python | File Handling Tutorial in Python
Duration:19:30
Viewed:14,778
Published:05-05-2021
Source:Youtube

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



SHARE TO YOUR FRIENDS


Download Server 1


DOWNLOAD MP4

Download Server 2


DOWNLOAD MP4

Alternative Download :