mirror of
https://github.com/github/codeql.git
synced 2025-12-26 05:36:32 +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(...) |