In this video tutorial I demonstrate how to read a text file by using 2 methods:
1st one: content = file.read() : 1:16
2nd one: content = file.readline() : 2:03
On the second case we have an issue when "\n" sign is appear to our result in Windows console. For removing this sign we use rstrip function in Python.
rstrip function should be implemented in one line For cycle as it shown in 2:41.
I tried to put as many useful comments for Python beginners as it need. I hope it will be useful for all beginners and more experienced Python developers.
Using freeware for Python code editing: Bracket (download link: https://github.com/adobe/brackets/rel...)
Other my Python video tutorials:
1. How to import a 3rd party module package to Python 3.5.2 - • Python tutorial: Import 3rd party module p...
2. Python: OpenStreetMap API - set Longitudes and Latitudes by using Geopy module: • Python: OpenStreetMap API - add Longitudes...
If you have any question just write a comment below!
Please SUBSCRIBE ME for more Python videos in my Youtube channel!
On this page of the site you can watch the video online Python tutorial: read text file (2 simple methods) with a duration of hours minute second in good quality, which was uploaded by the user Data Science Garage 09 March 2017, share the link with friends and acquaintances, this video has already been watched 1,837 times on youtube and it was liked by 22 viewers. Enjoy your viewing!