File: parsejson.py

package info (click to toggle)
cctools 1%3A7.15.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 40,008 kB
  • sloc: ansic: 117,215; python: 30,569; cpp: 20,301; sh: 13,834; perl: 4,056; xml: 3,688; makefile: 1,502
file content (26 lines) | stat: -rwxr-xr-x 586 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import json
import sys
import os

#json_data='{"a":1, "b":2, 'c':3. "d":4, "e":5}'

#parsed_json = (json.loads(json_data))
#print(json.dumps(parsed_json, indent = 4, sort_keys=True)
 
 
#FILENAME = 'resource_output.summary'

#f = open(FILENAME, "r")

resource_output_json = json.load(sys.stdin)

#print(type(resource_output_json))



print('{}\t{}\t{}\t{}\t{}\t{}'.format(os.environ['scale'],
resource_output_json["wall_time"][0],
resource_output_json["memory"][0],
resource_output_json["cores_avg"][0],
resource_output_json["bytes_read"][0],
resource_output_json["bytes_written"][0]))