#!/usr/bin/python

import os, requests, json

query = {"step_id":"102d_A_DC_1_DG_2","d":"155.9","e":"182.7","z":"254.9","a1":"311.5","b1":"187.5","g1":"22.9","d1":"149.7","ch":"249.1","ch1":"263.8","NN":"4.48", "CC":"5.13", "NCCN":"16.4","P":"168.5","P1":"163.5"}

dnatco_cgi = "https://dnatco.datmos.org/cgi-bin/assign_from_torsions_35.py"

try:
    r = requests.post(dnatco_cgi, json=query)
    jsonres = r.json()
except Exception, e:
    print repr(e)
    os.exit()

if (jsonres["error"] == ""):
    print(jsonres["result"]["NtC"], jsonres["result"]["confalH"])
else:
    print(jsonres["error"])
