Files
python----/智慧校园/同文/闸机下发学生.ipynb
2025-10-20 12:32:18 +08:00

25 KiB

In [1]:
from requests import get,post
import time
ip = "http://band.hxzhxy.cn"
param = {
    "username": "tangchao",
    "password": "123456a",
    "client_id": "client",
    "grant_type": "password",
    "client_secret": "123456",
}
data = get(url=f"http://band.hxzhxy.cn/oauth/token?username=zhongwei&password=123456a&client_id=client&grant_type=password&client_secret=123456").json()
token = data["access_token"]
header = {
    "content-type": "application/json",
    "authorization": f"Bearer {token}",
}
In [ ]:
data = get(f"https://band.hxzhxy.cn/card/listStuWithRule?gradeId=&classId=&screen=0&param=&type=1&currentPage=1&pageNumber=0&pageSize=100&pageTotal=640&teamId=119&access_token={token}").json()
In [ ]:
for i in range(0,7):
    data = get(f"https://band.hxzhxy.cn/card/listStuWithRule?gradeId=&classId=&screen=0&param=&type=1&currentPage=1&pageNumber={i}&pageSize=100&pageTotal=640&teamId=119&access_token={token}").json()
    a = [item['手环号'] for item in data["data"]["listData"]]
    tem = post(f"https://band.hxzhxy.cn/card/sendUserRule?access_token={token}",json={"typeId":[114,115,122,121,117],"bandNos":a,"type":1}).text
    print(tem)
{"success":true,"msg":"操作成功","code":0,"data":null}
{"success":true,"msg":"操作成功","code":0,"data":null}
{"success":true,"msg":"操作成功","code":0,"data":null}
{"success":true,"msg":"操作成功","code":0,"data":null}
{"success":true,"msg":"操作成功","code":0,"data":null}
{"success":true,"msg":"操作成功","code":0,"data":null}
{"success":true,"msg":"操作成功","code":0,"data":null}
在当前单元格或上一个单元格中执行代码时 Kernel 崩溃。

请查看单元格中的代码,以确定故障的可能原因。

单击<a href='https://aka.ms/vscodeJupyterKernelCrash'>此处</a>了解详细信息。

有关更多详细信息,请查看 Jupyter <a href='command:jupyter.viewOutput'>log</a>。
In [ ]:
 post(f"https://band.hxzhxy.cn/card/sendUserRule?access_token=44c9b105-c44f-46f0-b15f-ef27d3a9f8b2",json={"typeId":[68,69,71,70,72],"bandNos":[ i["手环号"] for i in data["data"]["listData"]],"type":1}).text
In [ ]:
for item in data["data"]["listData"]:
    data1 = post(f"https://band.hxzhxy.cn/card/sendUserRule?access_token=44c9b105-c44f-46f0-b15f-ef27d3a9f8b2",json={"typeId":[68,69,71,70,72],"bandNos":[item['手环号']],"type":1}).text
    print(data1)
    time.sleep(1)
In [18]:
a = [item['手环号'] for item in data["data"]["listData"]]
In [20]:
post(f"https://band.hxzhxy.cn/card/sendUserRule?access_token=44c9b105-c44f-46f0-b15f-ef27d3a9f8b2",json={"typeId":[68,69,71,70,72],"bandNos":a,"type":2},proxies={"http": "http://127.0.0.1:8080", "https": "http://127.0.0.1:8080"},verify=False).text
Out [20]:
d:\Anaconda3\Lib\site-packages\urllib3\connectionpool.py:1099: InsecureRequestWarning: Unverified HTTPS request is being made to host '127.0.0.1'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
  warnings.warn(
'{"success":true,"msg":"操作成功","code":0,"data":null}'
In [ ]:
In [25]:
stus = get(f"https://band.hxzhxy.cn/card/listStuWithRule?gradeId=&classId=&screen=0&param=&type=1&currentPage=1&pageNumber={0}&pageSize=15&pageTotal=634&teamId=119&access_token=44c9b105-c44f-46f0-b15f-ef27d3a9f8b2").json()
In [ ]:
['0022681580',
 '0022678332',
 '0022679980',
 '0022678476',
 '0022678524',
 '0022702252',
 '0022702044',
 '0022702140',
 '0022702124',
 '0022681820',
 '0022681532',
 '0022681452',
 '0022683596',
 '0022702204',
 '0022702028']
In [6]:
for i in range(3,44):
    stus = get(f"https://band.hxzhxy.cn/card/listStuWithRule?gradeId=&classId=&screen=0&param=&type=1&currentPage={i+1}&pageNumber={i}&pageSize=15&pageTotal=634&teamId=119&access_token={token}").json()
    a = [item['手环号'] for item in stus['data']['listData']]
    print(a)
    post(f"https://band.hxzhxy.cn/card/sendUserRule?access_token={token}",json={"typeId":[114,115,122,121,117],"bandNos":a,"type":1})
    time.sleep(1)
['0022722732', '0022722204', '0022720572', '0022722220', '0022722780', '0022752940', '0022752972', '0022722492', '0022753020', '0022753004', '0022720716', '0022722508', '0022722748', '0022722700', '0022720732']
['0022754908', '0022795916', '0022754844', '0022795804', '0022755100', '0022755164', '0022757068', '0022754780', '0022755132', '0022755148', '0022754972', '0022754940', '0022753212', '0022757132', '0022795772']
['0022797964', '0022799916', '0022797868', '0022796108', '0022799868', '0022797900', '0022800028', '0022795948', '0022797916', '0022800860', '0022799884', '0022796140', '0022796172', '0022796156', '0022796012']
['0022819052', '0022821084', '0022820892', '0022818908', '0022821116', '0022821036', '0022820844', '0022818956', '0022820716', '0022817020', '0022816716', '0022819036', '0022816700', '0022818588', '0022818764']
['0022821132', '0022822700', '0022822732', '0022832380', '0022822828', '0022834044', '0022836044', '0022832044', '0022832396', '0022834268', '0022822908', '0022832156', '0022830076', '0022832124', '0022830300']
['0023039868', '0023039836', '0023036860', '0023038412', '0023036556', '0023038524', '0023040012', '0023040156', '0023034668', '0023034844', '0023039948', '0023039916', '0023039980', '0023034780', '0023038492']
['3107628929', '3107632929', '3107630609', '3107628945', '3107626657', '3107630481', '0023040172', '3107628881', '3107628561', '3107628753', '3107630913', '3107630545', '3107630689', '3107632913', '3107630833']
['3108338497', '3108338641', '3108340497', '3108339457', '3108340577', '3108338705', '3107633041', '3108338817', '3108336817', '3108336529', '3108336449', '3108336657', '3108336753', '3108336497', '3108338881']
['3108342545', '3108340881', '3108342641', '3108340657', '3108340753', '3108341473', '3108342561', '3108354337', '3108354401', '3108354417', '3108340913', '3108340801', '3108340625', '3108340945', '3108340609']
['3108356609', '3108358705', '3108358529', '3108356657', '3108356689', '3108358609', '3108354753', '3108358657', '3108356769', '3108354449', '3108354593', '3108354673', '3108356577', '3108356321', '3108358641']
['3108359393', '3108359681', '3108363521', '3108361393', '3108363665', '3108361553', '3108359713', '3108358769', '3108359649', '3108358737', '3108358785', '3108359489', '3108359633', '3108359745', '3108359761']
['3108388113', '3108363761', '3108386497', '3108363841', '3108386177', '3108388321', '3108363745', '3108388513', '3108388337', '3108386257', '3108386433', '3108363681', '3108388129', '3108388193', '3108365969']
['3108392369', '3108392337', '3108390369', '3108390305', '3108393969', '3108390081', '3108392193', '3108390481', '3108390161', '3108390241', '3108390065', '3108390273', '3108390097', '3108392049', '3108390145']
['3108395969', '3108394305', '3108394097', '3108396001', '3108394065', '3108396097', '3108396273', '3108396225', '3108396257', '3108396113', '3108394385', '3108396289', '3108394001', '3108394353', '3108395985']
['3108417073', '3108415441', '3108415473', '3108398081', '3108398193', '3108415393', '3108413633', '3108415601', '3108413761', '3108415697', '3108398129', '3108413729', '3108397889', '3108398209', '3108415505']
['3108419185', '3108419121', '3108418881', '3108417089', '3108418993', '3108435553', '3108433793', '3108435585', '3108433889', '3108435537', '3108417425', '3108435569', '3108418945', '3108435409', '3108435617']
['3108439089', '3108436273', '3108437121', '3108439073', '3108437457', '3108437249', '3108437217', '3108438961', '3108435633', '3108437489', '3108439105', '3108435713', '3108435745', '3108438913', '3108437409']
['3108444273', '3108442561', '3108442881', '3108442785', '3108442545', '3108439233', '3108444209', '3108440913', '3108441649', '3108442849', '3108440897', '3108441105', '3108440785', '3108441121', '3108441041']
['3108445761', '3108444401', '3108445841', '3108444449', '3108460625', '3108445825', '3108460497', '3108460673', '3108462305', '3108445809', '3108460689', '3108460545', '3108460753', '3108462225', '3108460593']
['3108464193', '3108462417', '3108464129', '3108462449', '3108464257', '3108462465', '3108462433', '3108464177', '3108462593', '3108462385', '3108464465', '3108462353', '3108464145', '3108464161', '3108462481']
['3108567809', '3108562849', '3108569601', '3108569009', '3108567777', '3108564433', '3108567841', '3108466369', '3108466545', '3108562881', '3108464545', '3108562897', '3108464497', '3108567729', '3108562801']
['3108569793', '3108571825', '3108571857', '3108571921', '3108571777', '3108571601', '3108569745', '3108570049', '3108569761', '3108569873', '3108569697', '3108571761', '3108572001', '3108571681', '3108572065']
['3108572081', '3108582545', '3108583137', '3108583313', '3108583057', '3108573793', '3108582993', '3108582561', '3108583185', '3108583153', '3108582593', '3108573713', '3108580737', '3108582913', '3108582737']
['3108586737', '3108584337', '3108586769', '3108584129', '3108586657', '3108583345', '3108586865', '3108586513', '3108584289', '3108586545', '3108584241', '3108584065', '3108586881', '3108584193', '3108586817']
['3108590817', '3108590609', '3108590705', '3108588593', '3108589057', '3108588673', '3108588993', '3108590785', '3108588961', '3108588785', '3108588689', '3108588801', '3108586929', '3108588849', '3108588817']
['3108590833', '3108590865', '3108595409', '3108594545', '3108594369', '3108591057', '3108595249', '3108594513', '3108595425', '3108594289', '3108595377', '3108590993', '3108594273', '3108595441', '3108595281']
['3108597281', '3108596657', '3108597329', '3108596577', '3108596401', '3108597313', '3108596337', '3108598721', '3108596545', '3108597633', '3108596369', '3108598337', '3108597553', '3108598753', '3108598561']
['3108599409', '3108600385', '3108600673', '3108599617', '3108600785', '3108600401', '3108599425', '3108599569', '3108601425', '3108600305', '3108600737', '3108600529', '3108600849', '3108600817', '3108600609']
['3108602593', '3108602465', '3108601585', '3108602577', '3108602753', '3108602433', '3108602785', '3108601457', '3108601489', '3108601841', '3108602625', '3108601601', '3108601537', '3108601713', '3108601729']
['3108604897', '3108604721', '3108604545', '3108603841', '3108604513', '3108603633', '3108604865', '3108603553', '3108604961', '3108603873', '3108602865', '3108603601', '3108604833', '3108603409', '3108603729']
['3108606081', '3108605073', '3108606241', '3108606065', '3108605041', '3108605345', '3108605697', '3108605761', '3108606145', '3108605505', '3108605009', '3108604977', '3108605537', '3108605729', '3108605809']
['3108612481', '3108607553', '3108609633', '3108607521', '3108607873', '3108607633', '3108606273', '3108606433', '3108606321', '3108606449', '3108607617', '3108606337', '3108607729', '3108606417', '3108612449']
['3108614257', '3108614577', '3108614401', '3108616209', '3108614209', '3108614081', '3108616193', '3108612513', '3108614481', '3108614241', '3108616145', '3108614353', '3108616289', '3108614145', '3108614321']
['3108616545', '3108618417', '3108616401', '3108618305', '3108622209', '3108618209', '3108622289', '3108622145', '3108622241', '3108622273', '3108624065', '3108616481', '3108618321', '3108616497', '3108618401']
['3108624769', '3108625825', '3108625889', '3108625921', '3108627793', '3108624257', '3108626465', '3108626289', '3108626177', '3108624097', '3108627777', '3108626033', '3108626065', '3108626193', '3108627937']
['3108629281', '3108628065', '3108629681', '3108629521', '3108629345', '3108629553', '3108629457', '3108629313', '3108629329', '3108628129', '3108629505', '3108630753', '3108630737', '3108631361', '3108631313']
['3108633185', '3108635073', '3108632849', '3108631425', '3108633009', '3108632769', '3108631441', '3108634897', '3108632993', '3108633697', '3108632753', '3108633249', '3108633233', '3108634993', '3108634257']
['3108637201', '3108637185', '3108648801', '3108637281', '3108648737', '3108649057', '3108652545', '3108652513', '3108650977', '3108637217', '3108650865', '3108637105', '3108650577', '3108652497', '3108635137']
['3108654273', '3108679793', '3108680001', '3108652849', '3108680033', '3108681873', '3108681793', '3108681777', '3108652753', '3108679537', '3108679985', '3108654497', '3108652561', '3108654433', '3108654289']
['3108681969', '3108683761', '3108682001', '3108682097', '3108684033', '3108683665', '3108683841', '3108682081', '3108683889', '3108681921']
['3108417073', '3108342545', '3108614257', '3108562849', '3108635073', '0022797916', '3108595409', '3108433793', '0022755164', '3108629505', '3108354401', '3108624065', '3108630737', '3108605537', '3108464177', '3108396289', '0022703964', '3108586817', '3108435617', '3108614145', '3108386497', '3108464193', '3108340497', '3108417089', '3108616209', '0022797900', '0022722220', '3108582561', '3108629521', '3108386257', '3108594545', '3108652753', '3108652513', '3108569009', '3108354417', '3108466369', '3108571681', '3108586929', '3108650577', '3108441041', '3108342641', '3108388321', '3108439089', '0022722492', '0022679980', '3108627793', '3108626465', '3108571777', '3108607617', '0022678524', '0022755148', '3108569697', '3108398129', '3108435713', '3108614481', '3108614241', '3108637105', '0023038492', '0022702412', '3108616545', '3108582545', '3108361393', '3108419121', '0022821084', '0022818908', '3108388337', '3108439073', '3108573713', '3108589057', '3108354753', '0022755132', '3108607729', '0022836044', '0022681820', '3108433889', '3108682081', '3108618417', '3107628929', '3108607521', '3107633041', '3108605345', '3108629553', '3108606433', '3108629313', '3108626289', '3108594513', '3108396001', '3108394065', '3108354449', '3108616481', '3108652561', '3108562801', '3108618305', '3108637185', '0022800028', '0023040156', '3108629681', '3108607873', '0022795804', '3108460625', '3108607633', '3108388513', '3108605697', '3108354337', '3108626177', '3108632849', '3108571761', '3108606417', '0022816716', '3108396257', '3108441121', '3108616497', '0022757132', '3108444273', '3108582993', '3108356609', '3108341473', '3108342561', '3108571857', '3108606449', '3108652545', '3108630753', '3108460753', '3108398209', '0022702332', '3108618401', '0022816700', '0023040012', '0022795948', '3108637281', '3108569793', '3108606321', '3108624097', '3108626033', '3108394097', '3108441105', '3108396273', '0022702444', '3108354673', '0022702204', '0022830300', '0022754908', '3108398193', '0022821036', '3108604721', '3108603633', '3108336817', '3108604961', '0022757068', '3108602785', '3108358609', '3108603873', '3108601457', '0022704892', '3108569873', '3108650865', '3108582737', '3108634257', '3108633185', '0022797868', '3108683665', '3108680033', '3108398081', '3107626657', '3108622289', '3108571601', '3108569761', '3108460545', '3108604833', '3108358737', '0022702460', '3108650977', '3107630913', '0022702348', '3108605809', '3108390369', '0022819052', '3108682001', '0023038524', '0022752940', '3107628945', '3108625889', '0022821132', '3108415393', '3108358705', '3108600385', '3108604865', '3108460673', '0022702252', '3108356769', '0023039980', '3108390481', '3108390241', '0022681532', '0023039868', '3108614401', '3108612481', '0023038412', '3108439233', '3108571825', '3108622145', '3108601585', '3108356657', '3108569745', '3108602433', '3108622273', '3108460689', '3108439105', '3108604977', '0022702124', '3108603409', '3108354593', '0022704300', '3108614577', '3108418881', '3108390305', '3107630609', '3108680001', '3108652849', '0022821116', '3108602593', '3108624257', '0022678476', '3108602465', '3108358529', '3108588593', '3108603553', '3108567777', '0022702396', '3108358769', '0022703004', '0022819036', '3108417425', '3108358641', '3108388113', '3108616401', '3108386177', '3108338817', '3108571921', '3107628881', '3108604513', '3108569601', '3108602577', '3108627777', '3108358657', '3108590785', '0022754940', '3108601489', '0022702140', '3108396097', '0022702268', '3108605729', '3108637217', '3108359745', '0022795772', '3108614353', '3107630833', '0022702028', '0022799916', '0022678332', '3108415473', '3108462417', '3108388129', '3108605761', '3108604545', '3108356689', '3108359713', '3107628753', '3108440785', '3108580737', '3108336753', '3108460593', '3108356321', '3108582913', '3108614321', '3108597281', '3108637201', '0022797964', '3108683761', '3108418993', '3108393969', '3108614209', '0022752972', '3108683889', '3108604897', '3108437249', '3108462305', '3108440897', '0022702044', '3108605505', '3108437489', '3108588689', '3108356577', '3108635137', '3108392369', '3108394305', '0022718412', '3108654273', '3108625825', '3108436273', '3108437121', '3108681777', '0023039916', '3108584193', '3108460497', '3108588673', '0022704012', '3108600401', '3108462433', '3108336657', '3108599569', '3108590993', '3108634897', '3108340801', '3108390065', '3108600529', '0022796156', '3108622209', '3108584065', '3108606065', '3108590865', '0022800860', '3108442849', '3107628561', '3108462449', '3108336529', '3108588785', '3108415697', '3108601841', '3108601601', '3108633697', '0022720716', '3108654497', '0022796140', '3108601729', '0022716492', '0023036860', '3107632929', '0022754844', '3108648801', '3108338705', '3108625921', '3108681793', '3108437457', '3108441649', '3108437217', '3108600785', '3108390081', '0022754972', '3108599425', '3108598337', '3108358785', '3108600305', '3108359633', '3108572065', '0022796172', '3108631361', '3108634993', '3108572081', '3108606081', '3108590609', '3108584289', '3108415441', '3108683841', '0022822732', '3108462465', '3108567841', '3108359649', '3108462225', '0022817020', '3108340913', '0022704028', '3108612513', '0022704268', '3108390097', '3108598561', '3108418945', '3108567729', '0022832124', '3108359761', '3107632913', '0022720732', '3108338641', '0023039836', '3108363841', '0022796108', '0022718332', '3108590833', '3108583185', '3108599409', '3108622241', '3108588993', '3108602865', '3108633009', '3108602625', '3108388193', '3108462593', '3108601537', '0022830076', '3108633249', '3108462353', '3108340609', '3108595281', '3107630689', '0022818588', '0022722700', '3108390145', '3108395969', '3108392337', '3108442881', '3108583057', '0022820892', '3108648737', '3108590705', '3108679537', '3108681969', '3108600673', '0022754780', '0022832380', '0022822828', '3108564433', '0022704044', '3108336449', '3108596369', '0022753212', '0022706220', '3108464545', '3108627937', '0022706108', '3108390273', '3108462481', '0022722732', '0022681580', '3108590817', '3108359681', '3108679793', '3108681873', '0022822700', '3108445809', '3108597329', '0022706252', '3108612449', '0022704076', '0022832396', '0022799884', '3108390161', '0022832156', '3108340945', '3107630545', '0022681452', '3108654289', '0022796012', '3108415505', '3108567809', '3108584129', '3108586545', '3108624769', '0023036556', '0022799868', '3108442785', '3108442545', '3108584241', '3108583153', '0023039948', '3108603841', '3108435585', '3108602753', '3108599617', '3108588961', '3108594289', '3108595377', '0022704188', '3108597313', '3108603601', '3108601425', '0022832044', '3108597553', '3108603729', '3108462385', '3108588849', '3108395985', '3108633233', '0022720412', '3108437409', '3108338881', '3108363761', '3108340881', '3108363521', '3108586657', '0022720572', '3108445825', '0022753020', '3108595249', '3108415601', '3108631425', '3108596577', '3108438961', '3108596337', '3108594273', '3108572001', '3108632993', '3108598753', '0022722508', '3108394385', '3108632753', '0022722748', '3108336497', '3108616289', '3108359393', '0022720444', '3108586769', '3108442561', '3108340657', '3108583137', '3108607553', '3107630481', '3108586881', '3108681921', '3108440913', '0022820844', '3108606337', '3108605009', '3108632769', '0022822908', '3108464465', '3108435569', '3108631313', '0022720476', '0022718396', '3108584337', '3108586513', '3108363745', '3108445841', '0022795916', '0023034844', '3108605041', '3108629457', '3108435553', '3108629329', '3108570049', '3108679985', '3108413761', '3108626065', '0022820716', '3108614081', '0022753004', '3108396225', '3108618321', '3108340625', '3108616145', '0022818764', '3108588817', '3108586865', '3108444401', '3108573793', '3108340753', '3108618209', '3108609633', '3108606241', '3108629345', '3108386433', '3108361553', '0023040172', '3108594369', '3108649057', '3108464129', '3108628129', '3108598721', '3108466545', '3108596545', '3108597633', '3108626193', '3108359489', '0022834268', '3108396113', '3108588801', '3108600817', '3108586737', '3108339457', '3108583345', '3108628065', '0023034668', '3108606273', '3108363681', '3108596657', '3108464257', '3108562881', '3108435537', '3108595441', '3108464497', '3108392049', '3108600849', '3108600609', '3108338497', '3108419185', '0022718284', '3108629281', '3108340577', '3108682097', '0022722780', '3108684033', '3108606145', '0022706188', '3108413633', '3108596401', '0022834044', '3108562897', '3108394353', '3108464145', '3108438913', '3108435409', '3108445761', '3108363665', '0022706092', '3108582593', '0022755100', '3108595425', '3108435633', '3108631441', '3108413729', '3108365969', '3108601713', '3108394001', '0022683596', '0022722204', '3108605073', '3108583313', '3108444449', '3108444209', '3108591057', '0022818956', '3108616193', '3108392193', '3108397889', '3108435745', '3108600737', '3108654433', '0023034780', '3108464161', '3108652497']