-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBotTemplate.py
More file actions
32 lines (25 loc) · 728 Bytes
/
Copy pathBotTemplate.py
File metadata and controls
32 lines (25 loc) · 728 Bytes
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
27
28
29
30
31
32
from __future__ import unicode_literals
import json
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--infile', nargs=1,
help="JSON file to be processed",
type=argparse.FileType('r'))
args = parser.parse_args()
# Loading a JSON object returns a dict.
d = json.load(args.infile[0])
profileInfo = {}
profileInfo.update(d)
input = profileInfo[u'input']
output = profileInfo[u'output']
location = profileInfo[u'location']
name = None
greeting = None
for data in input:
if data[u'name'] == u'Name':
name = data[u'value']
if data[u'name'] == u'Greeting':
greeting = data[u'value']
import os
if __name__ == "__main__":
print(str(name) + " " + str(greeting))