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!
Sur cette page du site, vous pouvez voir la vidéo en ligne Python tutorial: read text file (2 simple methods) durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Data Science Garage 09 mars 2017, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,837 fois et il a aimé 22 téléspectateurs. Bon visionnage!