随笔分类 -  python

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 48 下一页
摘要:Content-disposition 是 MIME 协议的扩展,MIME 协议指示 MIME 用户代理如何显示附加的文件。Content-disposition其实可以控制用户请求所得的内容存为一个文件的时候提供一个默认的文件名,文件直接在浏览器上显示或者在访问时弹出文件下载对话框。Content 阅读全文
posted @ 2019-09-15 21:01 anobscureretreat 阅读(1372) 评论(0) 推荐(0)
摘要:python2中进行Base64编码和解码 python3不太一样:因为3.x中字符都为unicode编码,而b64encode函数的参数为byte类型,所以必须先转码。 阅读全文
posted @ 2019-09-14 01:27 anobscureretreat 阅读(8613) 评论(0) 推荐(1)
摘要:如果按照 .* 去匹配,最后会把 /edit/ 和 /delete/ 也匹配进去。 所以使用 [-\w+] 表示匹配 - 符号(短横线 hyphen),以及所有小写的英文字母。 参考: https://www.jianshu.com/p/8207b66db9ca https://www.cnblog 阅读全文
posted @ 2019-09-14 01:19 anobscureretreat 阅读(468) 评论(0) 推荐(0)
摘要:修改settings.py 静态文件配置 在settings.py文件目录中,添加文件view.py 在settings.py文件目录中,修改文件urls.py 可能会报错 说明接口函数少传了一个参数 参数: https://blog.csdn.net/geek_xiong/article/deta 阅读全文
posted @ 2019-09-11 00:02 anobscureretreat 阅读(1439) 评论(0) 推荐(0)
摘要:#前进 driver.back() #后退 driver.forward() #刷新 driver.refresh() #退出 driver.quit() #获取所有 cookie cookies=driver.get_cookies() #删除所有 cookie 信息。 driver.delete_all_cookies() #获取cookie cookie=driver.ge... 阅读全文
posted @ 2019-09-10 21:24 anobscureretreat 阅读(227) 评论(0) 推荐(0)
摘要:启动pydoc查看文档 python3 -m pydoc -p 6789 访问http://localhost:6789 或者查看官方文档:https://seleniumhq.github.io/selenium/docs/api/py/api.html 阅读全文
posted @ 2019-09-10 21:20 anobscureretreat 阅读(344) 评论(0) 推荐(0)
摘要:#导入库 import pymysql #创建数据库 conn=pymysql.connect(host='localhost',port=3306,db='test',user='root',passwd='password',charset ='utf8') cur=conn.cursor() #查询原数据-----------------------------------------... 阅读全文
posted @ 2019-09-10 21:16 anobscureretreat 阅读(151) 评论(0) 推荐(0)
摘要:print(int("54", 8))# 表示把8进制的54转换成十进制数并输出结果。# 8可以是2、8,10,16等进制数 https://www.cnblogs.com/aaronthon/p/9446048.html 阅读全文
posted @ 2019-09-09 10:25 anobscureretreat 阅读(365) 评论(0) 推荐(0)
摘要:多个字符中选取特定数量的字符:>>> import randomrandom.sample('abcdefghij',3) ['a', 'd', 'b']多个字符中选取特定数量的字符组成新字符串:>>> import random>>> import string>>> string.join(ra 阅读全文
posted @ 2019-09-09 10:24 anobscureretreat 阅读(919) 评论(0) 推荐(0)
摘要:datetime.datetime.now().strftime('%Y-%m-%d') 参考:https://www.cnblogs.com/general-seven/p/5893744.html 阅读全文
posted @ 2019-09-09 10:23 anobscureretreat 阅读(229) 评论(0) 推荐(0)
摘要:输出 参考:https://blog.csdn.net/qiubingcsdn/article/details/83079235 阅读全文
posted @ 2019-09-09 10:22 anobscureretreat 阅读(6422) 评论(0) 推荐(0)
摘要:import hashlib hash = hashlib.md5() hash.update(text.encode('utf-8')) print(hash.hexdigest()) 阅读全文
posted @ 2019-09-08 22:44 anobscureretreat 阅读(194) 评论(0) 推荐(0)
摘要:my_private_rsa_key.bin code 参考: https://github.com/Legrandin/pycryptodome 阅读全文
posted @ 2019-09-08 16:04 anobscureretreat 阅读(993) 评论(0) 推荐(0)
摘要:pip3.6 install https://github.com/darklow/django-suit/tarball/v2 阅读全文
posted @ 2019-09-06 23:42 anobscureretreat 阅读(276) 评论(0) 推荐(0)
摘要:pip3.6 install djangorestframework 阅读全文
posted @ 2019-09-06 23:41 anobscureretreat 阅读(1037) 评论(0) 推荐(0)
摘要:pip3.6 install django-rest-swagger 阅读全文
posted @ 2019-09-06 23:40 anobscureretreat 阅读(2750) 评论(0) 推荐(0)
摘要:ModuleNotFoundError: No module named 'suit' 阅读全文
posted @ 2019-09-06 23:39 anobscureretreat 阅读(470) 评论(0) 推荐(0)
摘要:test.py PyYAML 5.1 deprecation of the plain yaml.load(input) function . 解决掉警告的方法: yaml.warnings({'YAMLLoadWarning': False}) yaml.load(input, Loader=ya 阅读全文
posted @ 2019-09-04 00:57 anobscureretreat 阅读(3013) 评论(0) 推荐(0)
摘要:virtualenv --no-site-packages -p python3.7 testenv source testenv/bin/activate deactivate 参考;https://www.liaoxuefeng.com/wiki/1016959663602400/1019273 阅读全文
posted @ 2019-09-04 00:54 anobscureretreat 阅读(2238) 评论(0) 推荐(0)

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 48 下一页