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!
Auf dieser Seite können Sie das Online-Video Python tutorial: read text file (2 simple methods) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Data Science Garage 09 März 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,837 Mal angesehen und es wurde von 22 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!