diff options
author | Christoph Gerneth <login@gerneth.info> | 2015-10-17 22:40:00 -0500 |
---|---|---|
committer | Christoph Gerneth <login@gerneth.info> | 2015-10-17 22:40:00 -0500 |
commit | a02bbe591bdf72423f4246815402ab23c61247b5 (patch) | |
tree | bd37d7c931205ce264d71c1068b24bee9d2d30c1 | |
parent | 728b29a87f45db08da883057b514e2dcf3049431 (diff) | |
download | bvg-grabber-a02bbe591bdf72423f4246815402ab23c61247b5.tar.gz bvg-grabber-a02bbe591bdf72423f4246815402ab23c61247b5.tar.bz2 bvg-grabber-a02bbe591bdf72423f4246815402ab23c61247b5.zip |
minor change in filewriting method
-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 |