Thursday, March 10, 2016

Reading a file in Python

Reading a file in Python is very easy. Below are two exaples.

1) We open a file, read its content and close the file

                                                                                                         
2) Using with statement, With statement executed two related operation as a pair. In this example with statement will automatically close the file.

5 Python: Reading a file in Python Reading a file in Python is very easy. Below are two exaples. 1) We open a file, read its content and close the file                  ...

No comments :

Post a Comment