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!
In questa pagina del sito puoi guardare il video online Python tutorial: read text file (2 simple methods) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Data Science Garage 09 marzo 2017, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,837 volte e gli è piaciuto 22 spettatori. Buona visione!