mirror of
https://github.com/github/codeql.git
synced 2025-12-24 12:46:34 +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(...) |