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!
На этой странице сайта вы можете посмотреть видео онлайн Python tutorial: read text file (2 simple methods) длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Data Science Garage 09 Март 2017, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 1,837 раз и оно понравилось 22 зрителям. Приятного просмотра!