Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

with open as file python

>>> with open('workfile') as f:
...     read_data = f.read()

>>> # We can check that the file has been automatically closed.
>>> f.closed
True
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #open #file #python
ADD COMMENT
Topic
Name
8+9 =