Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- event=getxml() //table 1- XML
- description = event.getname('921')
- xmlvalue = jsonify (description)
- conn=pymysql.connect(host='',user='',password='',db='') // table 2 - MYSQL
- a=conn.cursor()
- sql='SELECT logseq, logcode FROM `table2`Where Event_code = 921 '
- a.execute(sql)
- row_headers=[x[0] for x in a.description]
- data = a.fetchall()
- json_data=[]
- for result in data:
- json_data.append(dict(zip(row_headers,result)))
- jsonvalue = json.dumps(json_data)
- return (jsonvalue,xmlvalue)
- TypeError('Invalid status argument',)
Add Comment
Please, Sign In to add comment