summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Gerneth <login@gerneth.info>2015-10-17 22:40:00 -0500
committerChristoph Gerneth <login@gerneth.info>2015-10-17 22:40:00 -0500
commita02bbe591bdf72423f4246815402ab23c61247b5 (patch)
treebd37d7c931205ce264d71c1068b24bee9d2d30c1
parent728b29a87f45db08da883057b514e2dcf3049431 (diff)
downloadbvg-grabber-a02bbe591bdf72423f4246815402ab23c61247b5.zip
bvg-grabber-a02bbe591bdf72423f4246815402ab23c61247b5.tar.gz
bvg-grabber-a02bbe591bdf72423f4246815402ab23c61247b5.tar.bz2
minor change in filewriting method
-rwxr-xr-xbvg-grabber.py6
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