-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVisualization.py
More file actions
28 lines (21 loc) · 776 Bytes
/
Copy pathVisualization.py
File metadata and controls
28 lines (21 loc) · 776 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
#!/usr/bin/env python
import psycopg2
import sys
import json
def main():
Config_directory = "C:\\Users\\mahshad\\Desktop\\tmiv\\build\\source\\Encoder\\Release\\Cfg.json"
with open(Config_directory, 'r') as myfile:
Data = myfile.read()
Config_parameters = json.loads(Data)
data_type = Config_parameters["data_type"]
config_id = Config_parameters["config_id"]
values = "'" + sys.argv[1] + "'" + ", " + str(sys.argv[2]) + ", " + str(config_id)
db = data_type + "_tables"
Query = "insert into positions_of_packed_clusters values(" + values + ")"
conn = psycopg2.connect("dbname=%s user=postgres password=Bluesky7331" % db)
cur = conn.cursor()
cur.execute(Query)
conn.commit()
cur.close()
conn.close()
main()