concordia-docker/concordia-aligner/quick_search.py
2019-06-26 10:19:11 +02:00

28 lines
522 B
Python
Executable File

#!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import urllib2
import sys
import time
data = {
'operation': 'fullSearch',
'pattern':sys.argv[1],
'tmId':int(sys.argv[2]),
'limit':10,
'offset':0
}
address = 'http://127.0.0.1:10001'
start = time.time()
req = urllib2.Request(address)
req.add_header('Content-Type', 'application/json')
response = urllib2.urlopen(req, json.dumps(data)).read()
end = time.time()
print "Execution time: %.4f seconds." % (end-start)
print "Result: "
print response