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.
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.
No comments :
Post a Comment