first commit
This commit is contained in:
+116
@@ -0,0 +1,116 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def post(string):\n",
|
||||
" data = string.split(\"\\n\")\n",
|
||||
" length = len(data)\n",
|
||||
" for k,i in enumerate(data):\n",
|
||||
" index = i.find(\":\")\n",
|
||||
" if k == 0:\n",
|
||||
" print(\"{\"+f'''\"{i[0:index]}\":\"{i[index+1:].strip()}\",''')\n",
|
||||
" elif k == length-1:\n",
|
||||
" print(f'''\"{i[0:index]}\":\"{i[index+1:].strip()}\"'''+\"}\")\n",
|
||||
" else: print(f'''\"{i[0:index]}\":\"{i[index+1:].strip()}\",''')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def get(string):\n",
|
||||
" data = string.replace(\"=\",'''\":\"''').split(\"&\")\n",
|
||||
" for i in range(len(data)):\n",
|
||||
" data[i] = \"\\\"\"+data[i]+\"\\\",\"\n",
|
||||
" print(data[i])"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{\"teamId\":\"110\",\n",
|
||||
"\"gradeId\":\"119\",\n",
|
||||
"\"binding\":\"\",\n",
|
||||
"\"screen\":\"0\",\n",
|
||||
"\"pageSize\":\"10\",\n",
|
||||
"\"pageNumber\":\"1\",\n",
|
||||
"\"category\":\"1\",\n",
|
||||
"\"orderDirection\":\"asc\",\n",
|
||||
"\"access_token\":\"5a6d057e-d869-4746-933d-ceabfbbd686c\",\n",
|
||||
"\"\":\"\"}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"post('''teamId: 110\n",
|
||||
"gradeId: 119\n",
|
||||
"binding: \n",
|
||||
"screen: 0\n",
|
||||
"pageSize: 10\n",
|
||||
"pageNumber: 1\n",
|
||||
"category: 1\n",
|
||||
"orderDirection: asc\n",
|
||||
"access_token: 5a6d057e-d869-4746-933d-ceabfbbd686c\n",
|
||||
"''')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"{\n",
|
||||
" \"id\": 0.364749021124521,\n",
|
||||
" \"legalRepresentative\": \"\",\n",
|
||||
" \"editFlg\": false,\n",
|
||||
" \"saveFlg\": true,\n",
|
||||
" \"isApplyPeople\": 0,\n",
|
||||
" \"isDeleteItem\": true,\n",
|
||||
" \"country\": \"001\",\n",
|
||||
" \"province\": \"001042\",\n",
|
||||
" \"city\": \"001042001\",\n",
|
||||
" \"idType\": \"14\",\n",
|
||||
" \"peopleType\": \"4\",\n",
|
||||
" \"name\": \"李冬生\",\n",
|
||||
" \"idNumber\": \"52420000753406283N\",\n",
|
||||
" \"contactPerson\": \"\"\n",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "base",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.12.4"
|
||||
},
|
||||
"orig_nbformat": 4
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
Reference in New Issue
Block a user