diff options
-rwxr-xr-x | bvg-grabber.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/bvg-grabber.py b/bvg-grabber.py index 3964f83..3a2d623 100755 --- a/bvg-grabber.py +++ b/bvg-grabber.py @@ -59,7 +59,5 @@ if __name__ == '__main__': if args.file in ('stdout', '-'): print(res.to_json) else: - file = open(args.file, 'w') - print(res.to_json, file=file) - file.close() - + with open(args.file, 'w') as f: + print(res.to_json, file=f)
\ No newline at end of file |