- 后端将对象以对象形式传到前端:
from django.core.serializers import serialize def xxx(reqeust): project_list = models.ProjectManage.objects.filter(pk=id).first().projectmodel_set.all() return JsonResponse({"modelList": serialize('json', project_list),})
- selenium刷新页面
刷新页面:
driver.refresh()
- python获取cpu核数
from multiprocessing import cpu_count print(cpu_count()) >>> 4