#!/usr/bin/python3 import argparse import json def decode_json_files(json_files): for json_file in json_files: print(json_file) with open(json_file) as fp: parsed_json = json.load(fp) sdp = parsed_json['sdp'] print(sdp) print() def main(): parser = argparse.ArgumentParser(description='Decode SDP JSON') parser.add_argument('json', nargs='+', help='JSON file') args = parser.parse_args() decode_json_files(args.json) if __name__=='__main__': main()