- 博客(11)
- 收藏
- 关注
原创 python中dict的value为list时更新
for i in list1: dict.update({i:[1, 0, 0, 0, 0, 0, 0, 0, 0]}) print(i,dict[i])结果: [1, 0, 0, 0, 0, 0, 0, 0, 0] [1, 0, 0, 0, 0, 0, 0, 0, 0] [1, 0, 0, 0, 0, 0, 0, 0, 0] [1, 0, 0, 0, 0, 0, 0, 0, 0] [1, 0, 0, 0, 0, 0, 0, 0, 0]update里面不能用=,得用{}
2021-11-23 00:45:12 1230
原创 解决fake_useragent报错
#python代码from fake_useragent import UserAgentua = UserAgent(use_cache_server=False)print(UserAgent().chrome)headers = {'User-Agent': ua.random}然后找temp文件夹import tempfileprint(tempfile.gettempdir())在文件夹里里面新建fake_useragent_0.1.11.json{ "randomize
2021-10-22 00:17:09 896
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人