
python
小新文
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python requests实现multipart/form-data 请求
使用python的requests 发送multipart/form-data 请求实现模拟登录设置请求头headers = { "Accept": "application/json, text/javascript, */*; q=0.01", "Accept-Encoding": "gzip, deflate, br", "Accept-Language": "...原创 2019-06-13 17:46:57 · 1804 阅读 · 0 评论 -
Python 随机生成11位数字(电话号码)
随机生成11位电话号码import randomdef rabdomPhone(): headList = ["130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "147", "150", "151", "152", "153", "155", "156", "157...转载 2019-06-13 18:10:59 · 7300 阅读 · 0 评论 -
Python json笔记
json.load()是从文件中读出json格式的字符串;with open('test.json','r',encoding='utf-8') as f: print(json.load(f))json.loads()是将json格式的字符串转为字典类型。json.dumps()是将python中的字典类型转为字符串类型;json.dump()函数是将json格式的字符串写到一...原创 2019-06-14 10:01:03 · 240 阅读 · 0 评论 -
Django常见错误
这是我用django2.2连接MySQL5.5,迁移时报错django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required;解决方案找到python安装目录下的base.py文件,"C:\Python37\lib\site-packages\django\db\backends\mysq...原创 2019-06-14 15:57:15 · 255 阅读 · 0 评论 -
python requests文件上传
requests实现form表单文件上传 data = { "username": "test_user", 'nickname':"password" , } files = {'img': open("123.jpg", 'rb')} res = requests.post(url, data=data, files=files,...原创 2019-06-21 22:00:38 · 7003 阅读 · 2 评论 -
selenium,webdriver防止检测驱动
可以防止网站检测driveroption = ChromeOptions()option.add_experimental_option('excludeSwitches', ['enable-automation'])driver = Chrome(options=option)原创 2019-06-18 16:29:41 · 4709 阅读 · 2 评论 -
django 反向生成model
首先创建个app 然后将model导入#创建app 在manna.py Taskstartapp dyapp#将模型导入创建的app中去python manage.py inspectdb > dyapp/models.py原创 2019-07-23 10:21:55 · 529 阅读 · 0 评论 -
django使用celery
首先下载django_celery_beatpip install django_celery_beat配置INSTALLED_APPS配置celery settings文件下CELERY_BROKER_URL = 'redis://127.0.0.1:6379/0'CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379/0'CELERY_A...原创 2019-08-29 15:34:02 · 196 阅读 · 0 评论