随笔分类 -  python

python 学习
SX
摘要:echo "1: installig miniconda..."wget -O ~/Miniconda3-py38_4.9.2-Linux-x86_64.sh -c https://repo.anaconda.com/miniconda/Miniconda3-py38_4.9.2-Linux-x86 阅读全文
posted @ 2021-04-27 21:26 John Liang 阅读(1012) 评论(0) 推荐(0)
python操redis
摘要:Python操作redis python连接方式:点击 下面介绍详细使用 1、String 操作 redis中的String在在内存中按照一个name对应一个value来存储 set() mset() get(name) 获取值 mget(keys, *args) getset(name, valu 阅读全文
posted @ 2018-10-25 14:30 John Liang 阅读(198) 评论(0) 推荐(0)
python ConfigParser 的小技巧
摘要:$ cat format.conf [DEFAULT] conn_str = %(dbn)s://%(user)s:%(pw)s@%(host)s:%(port)s/%(db)s dbn = mysql user = root host=localhost port = 3306 [db1] use 阅读全文
posted @ 2018-03-21 19:30 John Liang 阅读(170) 评论(0) 推荐(0)
python 面试题
只有注册用户登录后才能阅读该文。
posted @ 2016-12-12 19:40 John Liang 阅读(5) 评论(0) 推荐(0)
装饰器小例子
摘要:import time def tm(*arg, **kwargs): def wrap_fun(fun): def wrap_arg(*arg, **kwargs): print time.time() fun(*arg, **kwargs) print time.time() return wr 阅读全文
posted @ 2016-07-29 18:02 John Liang 阅读(173) 评论(0) 推荐(0)
Python3.x和Python2.x的区别
摘要:1.性能 Py3.0运行 pystone benchmark的速度比Py2.5慢30%。Guido认为Py3.0有极大的优化空间,在字符串和整形操作上可 以取得很好的优化结果。 Py3.1性能比Py2.5慢15%,还有很大的提升空间。 2.编码 Py3.X源码文件默认使用utf-8编码,这就使得以下 阅读全文
posted @ 2016-07-29 16:59 John Liang 阅读(209) 评论(0) 推荐(0)
500lines项目简介
摘要:"500行或更少" "What I cannot create, I do not understand." -- Richard Feynman 《500行或更少》--开源应用架构系列第四版的源码。 项目的目的在于给阅读者更广的视野,让阅读者理解软件设计者的想法。 项目地址: https://gi 阅读全文
posted @ 2016-07-29 16:52 John Liang 阅读(1109) 评论(0) 推荐(0)
python 面试必读
摘要:总结了10道题的考试侧重点,供参考: 1.How are arguments passed – by reference of by value? 考的是语法,基本功,虽说python程序员可以不用关心堆栈指针那些头疼的东东,但传引用和传值的区别还是必需清楚的。个人感觉从python中一切都是对象的 阅读全文
posted @ 2016-07-28 18:06 John Liang 阅读(2225) 评论(0) 推荐(0)
Python list 操作
摘要:创建列表sample_list = ['a',1,('a','b')] Python 列表操作sample_list = ['a','b',0,1,3] 得到列表中的某一个值value_start = sample_list[0]end_value = sample_list[-1] 删除列表的第一 阅读全文
posted @ 2016-07-28 17:57 John Liang 阅读(6721) 评论(0) 推荐(0)