Files
python----/智慧校园/本部/建班级.ipynb
T
2025-10-20 12:32:18 +08:00

3.1 KiB

In [1]:
from requests import get,post
import time
ip = "http://band.hxzhxy.cn"
param = {
    "username": "zhongwei",
    "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 [2]:
for i in range(1,19):
    post(f"https://band.hxzhxy.cn/uc/class/add?access_token={token}",json={"gradeId":124,"teamId":19,"className":f"导师{i}","enabled":True})
In [3]:
区域1 = [4465-4433,4432-4400,4612-4464,4372-4352,4400-4372]
区域中间 = [4352-4304]
区域右上 = [4260-4236,4268-4260,4236-4216,4216-4196,4276-4268,4196-4180,4180-4172,4304-4276,4172-4156,4776-4664]
区域右下 = [4048-4000,4664-4612,4120-4048,4156-4120]
In [4]:
print(区域1,区域中间,区域右上,区域右下)
[32, 32, 148, 20, 28] [48] [24, 8, 20, 20, 8, 16, 8, 28, 16, 112] [48, 52, 72, 36]
In [6]:
print(sum(区域1))
print(sum(区域中间))
print(sum(区域右上))
print(sum(区域右下))
260
48
260
208
In [8]:
sum(区域1)+sum(区域中间)+sum(区域右上)+sum(区域右下)
Out [8]:
776