This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
for n in range(1,21):print("%s%s"%(("","Fizz")[not n%3],("","Buzz")[not n%5]) or n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Usage: jsonread.py <json_filename> <field> | |
import json | |
import sys #just for arguments | |
from pprint import pprint | |
with open(sys.argv[1]) as data_file: | |
data=json.loads(data_file.read()) | |
pprint(data['msg'][sys.argv[2]]) |