
python
大漠山鹰
strong, touch, cool, detached, with traditional views of masculinity
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python 进制转换小结
python 进制转换小结part 1: 十进制转16进制>>> hex(18)'0x12'part 2: 16进制转10进制>>> int(0x12)18# 如果遇到数字的字符串表示,‘18’, ‘0x12’:>>> int('18')原创 2011-09-13 21:54:25 · 5626 阅读 · 1 评论 -
Python中的ORM
ORM不是Python独享。因为我使用Python的时间更久,这里主要谈Python 中的ORM.经历了这么多事情,现在洁癖性的极力推崇某一种技术,或者极力反对某一种技术的已经比较少了。在Python 中,根据ORM 的实现层次,ORM 至少可以有3类:SQLAlchemy python中ORM的领军人物。就像Java中的Hibernate(至少大概5年以前是这样)Python-sql 对o原创 2015-08-23 17:30:42 · 851 阅读 · 0 评论 -
Python Exception 注意点
except xxx as e:except 老版本的Python,except语句写作”except Exception, e”,Python 2.6后应写作”except Exception as e”。except :try: do somethingexcept: handle except会捕获所有异常,包括键盘中断和程序退出请求(用sys.exit()就无法退出程原创 2015-09-06 17:13:06 · 1213 阅读 · 0 评论 -
使用 python3 环境开发。
安装python3 环境$ brew install python3… /usr/local/Cellar/python3/3.4.3/bin/python3==> Pouring python3-3.4.3.yosemite.bottle.10.tar.gz ==> Caveats Pip and setuptools have been installed. To update them原创 2015-09-26 15:25:41 · 794 阅读 · 0 评论 -
Python uuid
代码示例:>>> import uuid>>> print uuid.uuid1()ff614b46-504e-11e5-9fbd-00163e003fc6>>> print uuid.uuid1()07d1e966-504f-11e5-9fbd-00163e003fc6>>>>>>>>> print uuid.uuid3(uuid.NAMESPACE_DNS, 'testme')7原创 2015-09-01 10:25:15 · 809 阅读 · 0 评论 -
文章标题
Python 启动时的参数:查看帮助$ python --helpusage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...Options and arguments (and corresponding environment variables):-B : don't write .py[co] files o原创 2015-07-22 09:16:35 · 259 阅读 · 0 评论 -
Anacoda 简介
科学计算包 Anaconda Python http://www.oschina.net/p/Anaconda-Python 简介: Anaconda Python 是 Python 科学技术包的合集,功能和 Python(x,y) 类似。它是新起之秀,已更新多次了。包管理使用 conda,GUI基于 PySide,所有的包基本上都是最新版,没有PyQt和wxpython等,容量原创 2015-08-03 14:09:08 · 1503 阅读 · 0 评论 -
Python 中的descriptor
Python 中的descriptor原创 2015-07-22 09:29:25 · 262 阅读 · 0 评论 -
Python中的设计模式
Python中的设计模式原创 2015-07-21 10:00:40 · 368 阅读 · 0 评论 -
Python中修饰器
Python中修饰器原创 2015-07-21 10:01:57 · 345 阅读 · 0 评论 -
Python 中"元类"
Python 中”元类”原创 2015-07-21 10:02:59 · 277 阅读 · 0 评论 -
python queue 学习笔记
part 1:get help >>> import Queue>>> Queue.__all__['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue']>>> help(Queue)NAME Queue - A multi-producer, multi-consumer queue.原创 2011-09-27 21:43:19 · 2880 阅读 · 1 评论 -
关于python 逻辑运算的一个思考
# 有人试图做这样的运算, 判断 a 是 2 或者 a 是 3:>>> a = 2>>> if a == 2 or 3:... print 'if'... else:... print 'else'...if# 貌似可以。好吧,再来一遍。>>> a = 3>>> if a == 2 or 3:... prin原创 2012-01-06 16:58:46 · 968 阅读 · 0 评论 -
python socket 学习(1)
part 1: 最简单的socket 收发server.py:import sockets = socket.socket()host = socket.gethostname()port = 8001s.bind((hos原创 2011-09-27 22:09:04 · 935 阅读 · 0 评论 -
python built-in function 学习笔记
part 1: 几个参考的页面:built-in functions:http://docs.python.org/library/functions.htmlpython 内建函数:http://hi.baidu.com/c2cjushi/blog/item/3原创 2011-09-27 20:57:49 · 10530 阅读 · 0 评论