123456789101112131415161718192021222324252627282930313233343536373839 |
- def exec_def(cmd_str, obj):
- import requests
- json = requests.post("http://172.18.162.173:8000/exec", json={"function_str": cmd_str, "call_str": "exec(obj)", "param_dict": {"obj": obj}}).json()
- print(json)
- # ================[ 自定义部分 Start ]===============
- exec_str = """
- def exec(obj):
- return obj
- """
- obj = {
- "mail_type": "其他",
- "establish_time": None,
- "registcapi": "0.0",
- "reccap": "",
- "if_fest_phone": "是",
- "industry": None,
- "stockpercent": None,
- "subindustry": None,
- "credit_no": "111000000036931723",
- "cn_stockname": None,
- "province": "福建省",
- "econkind": None,
- "cn_change": None,
- "last_day_faren_change": None
- }
- # ================[ 自定义部分 End ]===============
- exec_def(exec_str, obj)
- def exec(obj):
- if 'name3' in obj:
- obj['name3'] = 1
- else:
- obj['name3'] = 2
- return obj
|