Open file via with
statement so it gets closed automatically.
This commit is contained in:
@ -303,9 +303,8 @@ def fake_it(image, start_date, username, repo, offset=0, multiplier=1,
|
|||||||
|
|
||||||
def save(output, filename):
|
def save(output, filename):
|
||||||
"""Saves the list to a given filename"""
|
"""Saves the list to a given filename"""
|
||||||
f = open(filename, "w")
|
with open(filename, "w") as f:
|
||||||
f.write(output)
|
f.write(output)
|
||||||
f.close()
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Reference in New Issue
Block a user