学习
Python 下各种环境隔离工具简介
· ☕ 3 分钟
1. 非标准库 1.1 virtualenv virtualenv 是一个非常流行的用于创建独立的python libraries环境的工具。我强烈推荐你学习并了解它,因为他非常实用,并且应用广泛,很多人用它来搭建python开发环境。后面其他工具来主要与virtualenv来进行比较以说明差

如何使用 Docker 开发个人项目
· ☕ 4 分钟
1. 关于个人项目 为什么强调是个人项目?商业项目对代码托管、开发、运维部署等环节有着冗长的流程。而对于个人开发者,这样的流程成本过高,不利于快速项目迭代。 个人项目可能是一次学习的 Demo。完成一个领域 Demo 是很好的技术学习思路。从零开始搭建一个完整

Python2 源码学习之字典和列表实现
· ☕ 6 分钟
1. 为什么字典比列表查询快 首先,请看下面这段代码 1 2 3 4 5 6 7 8 9 10 11 12 13 from time import time t = time() data = [chr(i) for i in range(97, 123)] # data = dict.fromkeys(data,True) print data for i in range(9999999): after_filter = [] for find in ['aa', 'b', 'cc', 'd', 'ee']: if find not in data: after_filter.append(find) print after_filter print time() - t 直接运行: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] ['aa', 'cc', 'ee'] 24.5699999332 去

Python2 VS Python3
· ☕ 1 分钟
1. Python 2 和 3 区别 特征\版本 Python 2 Python 3 print 函数化 print“abc” print(“abc”) 统一类 旧式类和新式类 只有新式类 浮点运算 1/2=0 1/2=0.5 字符串格式化 %,Format Format,% xrange 替代 range xrange range long 重命名为 int Long,int Int 包导入 相对导入 绝对导入 源文件编码 Ascii utf8 Python 官方强烈建议直接学习 Python 3,因为 Python 2 只维护到 2020 年。但是现

Python2 源码学习之 Windows 编译
· ☕ 3 分钟
1. 编译器准备 准备 Python 源码 在 Python 的官网,下载需要进行编译的 Python 版本源代码。这里选择的是 Python 2 的最新版本 Python-2.7.14.tar.xz,点击前往。 准备编译器 在 Windows 上,Python 2.7 的源代码内置的项目工程,支持 Visual Studio 2008、2010 打开。当然,V