import requests
global_var = 0 # 声明变量为全局变量
def get_department_json(access_token, department_id):
api_url = f'https://api.exmail.qq.com/cgi-bin/department/list?access_token={access_token}&id={department_id}'
response = requests.get(api_url)
json_data = response.json()
return json_data
def delete_department(access_token, department_id,nameck):
delete_api_url = f'https://api.exmail.qq.com/cgi-bin/department/delete?access_token={access_token}&id={department_id}'
delete_response = requests.get(delete_api_url)
delete_json_data = delete_response.json()
#print(f"已删除部门 ID: {department_id},已删除部门名称: {nameck},返回结果: {delete_json_data}")
global global_var
global_var += 1 # 修改全局变量的值
print(global_var) # 输出全局变量的值
def delete_departments_recursive(acces