mirror of
https://github.com/github/codeql.git
synced 2026-01-11 05:30:24 +01:00
10 lines
214 B
Python
10 lines
214 B
Python
|
|
f = open("filename")
|
|
try: # Method of ensuring file closure
|
|
f.write(...)
|
|
finally:
|
|
f.close()
|
|
|
|
|
|
with open("filename") as f: # Simpler method of ensuring file closure
|
|
f.write(...) |