+ 3
How to open file and read
3 odpowiedzi
+ 4
Here is a good explaination → http://www.pythonforbeginners.com/cheatsheet/JUMP_LINK__&&__python__&&__JUMP_LINK-file-handling
+ 2
var = open("filename.extension", "r")
0
By using "with" statement is the safest way to handle a file operation in Python because "with" statement ensures that the file is closed when the block inside with is exited.
with open("my_file.txt", "r") as my_file:
# do some file operations
http://net-informations.com/python/file/open.htm