cs_lang:python:things-to-know:files
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cs_lang:python:things-to-know:files [2010/12/12 19:19] – cedric | cs_lang:python:things-to-know:files [2010/12/12 19:21] (current) – cedric | ||
---|---|---|---|
Line 41: | Line 41: | ||
===== The with statement ===== | ===== The with statement ===== | ||
- | The better solution. No need to use **try: ... except: ...**. Forget the previous method. | + | The better solution. No need to use **try: ... except: ...**.\\ |
+ | Forget the previous method. | ||
<code python> | <code python> | ||
>>> | >>> | ||
- | ... a = f.read() | + | ... text = f.read() |
>>> | >>> | ||
- | >>> | + | >>> |
2664170 | 2664170 | ||
- | >>> | + | >>> |
. | . | ||
. | . |
cs_lang/python/things-to-know/files.1292177975.txt.gz · Last modified: 2010/12/12 19:19 by cedric