随笔分类 -  python

摘要:conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/ 阅读全文
posted @ 2019-12-19 01:19 忘记时间zms 阅读(2363) 评论(0) 推荐(0)
摘要:在项目下的路径下下运行 后面的端口换成其他可用的端口也可以 如何让外网也能访问呢,有待更新 阅读全文
posted @ 2019-05-25 13:12 忘记时间zms 阅读(343) 评论(0) 推荐(0)
摘要:转自 https://blog.csdn.net/zoulonglong/article/details/79869787 在使用pycharm时,经常会需要多行代码同时缩进、左移,pycharm提供了快捷方式 1、pycharm使多行代码同时缩进 鼠标选中多行代码后,按下Tab键,一次缩进四个字符 阅读全文
posted @ 2019-05-24 00:53 忘记时间zms 阅读(1617) 评论(0) 推荐(1)
摘要:正常变量赋值, 等号左右各一个空格; 参数赋值, 等号左右都没有空格; 注释#后面一个空格 类定义和函数定义,前后各两行,而在类的里面定义成员函数,只需要空一行 文件最后一个空行 变量、函数、类最好都是有意义的名字 阅读全文
posted @ 2019-05-23 20:56 忘记时间zms 阅读(130) 评论(0) 推荐(0)
摘要:转自: https://www.cnblogs.com/65702708/archive/2011/04/17/2018936.html Python格式化日期时间的函数为datetime.datetime.strftime();由字符串转为日期型的函数为:datetime.datetime.str 阅读全文
posted @ 2019-05-23 19:27 忘记时间zms 阅读(437) 评论(0) 推荐(0)
摘要:操他妈的, 阅读全文
posted @ 2019-05-23 18:27 忘记时间zms 阅读(384) 评论(0) 推荐(0)
摘要:[m:n] m,最小为0, 意思为从第m个字符开始 n,可以为负,负数从字符串尾部查,,意思为第n个以前的 阅读全文
posted @ 2019-05-23 18:03 忘记时间zms 阅读(744) 评论(0) 推荐(0)
摘要:项目中需要遍历tuple,而tuple的元素也是tuple,这样就会出现一些问题 当有多个元素的时候并没有问题,比如 这样是可以正常输出的,但是如果只有一个的话,就不行了 比如 这样就会报错,因为python 会自己去掉一层括号,这样tuple1就变成了元素是整数的tuple,而不是元素是tuple 阅读全文
posted @ 2019-05-22 09:55 忘记时间zms 阅读(794) 评论(0) 推荐(0)
摘要:不需要下载或者安装任何其他软件包,你可以指定一个高得离谱的版本号( 不可能有实际安装候选),并且可用的版本将被打印: pip install scrapy==122222 得到信息后指定版本就好了 pip查看所有可安装的包? 阅读全文
posted @ 2019-05-21 14:06 忘记时间zms 阅读(7358) 评论(0) 推荐(0)
摘要:转自: https://www.jianshu.com/p/06533f19c4ad 首先安装pip,如果用的python3版本要安装pip3(自行google) sudo apt install virtualenv pip3 install virtualenvwrapper 这里有可能出错,主 阅读全文
posted @ 2019-05-19 09:13 忘记时间zms 阅读(173) 评论(0) 推荐(0)
摘要:The directory '/home/zdj/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the p 阅读全文
posted @ 2019-05-18 22:43 忘记时间zms 阅读(560) 评论(0) 推荐(0)
摘要:转自: https://blog.csdn.net/xuezhangjun0121/article/details/81664260 pip国内的一些镜像 阿里云 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.u 阅读全文
posted @ 2019-05-17 22:47 忘记时间zms 阅读(352) 评论(0) 推荐(0)
摘要:1. Ctrl + A全选代码。2. Code -> Reformat Code 阅读全文
posted @ 2019-05-17 22:21 忘记时间zms 阅读(660) 评论(0) 推荐(0)
摘要:2. 可以使用搜索快速找到"File and Code Templates", 右侧菜单选择"Python Script",对模板进行编辑 格式为: ${<variable_name>},如常用的: ${USER} 当前系统用户 ${DATE} 当前系统日期 ${TIME} 当前系统时间 ${PRO 阅读全文
posted @ 2019-05-17 22:04 忘记时间zms 阅读(419) 评论(0) 推荐(0)
摘要:转自; https://blog.csdn.net/chenggong2dm/article/details/9368641 PyCharm 作为IDE,断点调试是必须有的功能。否则,我们还真不如用纯编辑器写的快。 【运行】和【调试】前的设置,详见前面的文章,helloword。 1,设置断点 在代 阅读全文
posted @ 2019-05-17 19:20 忘记时间zms 阅读(623) 评论(0) 推荐(0)
摘要:ctrl + 鼠标左键 阅读全文
posted @ 2019-05-17 18:42 忘记时间zms 阅读(2353) 评论(0) 推荐(0)
摘要:待更新: 建立python开发虚拟环境 virtualenv mkvirtualenv --python=the-path-to-the-python-you-want-to use 安装: 使用pip install scrapy就可以了,然后自动安装成功 新建scapy项目: 进入需要新建项目的 阅读全文
posted @ 2019-05-17 00:11 忘记时间zms 阅读(373) 评论(0) 推荐(0)
摘要:待解决: 阅读全文
posted @ 2019-05-17 00:10 忘记时间zms 阅读(121) 评论(0) 推荐(0)
摘要:dist-packages is a Debian-specific convention that is also present in its derivatives, like Ubuntu. Modules are installed to dist-packages when they c 阅读全文
posted @ 2019-05-16 17:02 忘记时间zms 阅读(750) 评论(0) 推荐(0)
摘要:https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-18-04 按照里面的步骤一步一步来就好,有时间会进行一下翻译 翻译: 第一步:先更新apt sudo apt update 第二步: 安装 阅读全文
posted @ 2019-05-15 13:24 忘记时间zms 阅读(153) 评论(0) 推荐(0)