上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 16 下一页
摘要: !/usr/bin/env python coding: UTF 8 from sqlalchemy.orm import mapper, sessionmaker __author__ = 'tan9le' from sqlalchemy import create_engine, Ta... 阅读全文
posted @ 2016-01-26 11:07 gopher-lin 阅读(268) 评论(0) 推荐(0)
摘要: coding:utf 8'''数字http://blog.csdn.net/hdutigerkin/article/details/6694884ceil(x) 取顶floor(x) 取底fabs(x) 取绝对值factorial (x) 阶乘hypot(x,y) sqrt(x x+y y)pow... 阅读全文
posted @ 2016-01-21 14:15 gopher-lin 阅读(177) 评论(0) 推荐(0)
摘要: 关键字参数:把参数名与值绑定在一起,使用参数名提供的参数叫做关键字参数。设置关键字参数默认值。 位置参数:带单个星号参数(以元祖形式输出) 关键字参数:带两个星号参数《以字典形式输出, 是一个元组类型的数值 def funcD(a, b, c): print a print b print ... 阅读全文
posted @ 2016-01-21 10:22 gopher-lin 阅读(632) 评论(0) 推荐(0)
摘要: metaclass的原理其实是这样的:当定义好类之后,创建类的时候其实是调用了type的__new__方法为这个类分配内存空间,创建 好了之后再调用type的__init__方法初始化(做一些赋值等)。所以metaclass的所有magic其实就在于这个__new__方法里面了。 说说这个方法:__... 阅读全文
posted @ 2016-01-21 10:03 gopher-lin 阅读(348) 评论(0) 推荐(0)
摘要: http://getbootstrap.com/getting started/ examples 阅读全文
posted @ 2016-01-20 20:49 gopher-lin 阅读(101) 评论(0) 推荐(0)
摘要: UnicodeEncodeError at /admin/home/article/add/ 'ascii' codec can't encode characters in position 3 6: ordinal not in range(128) import sys reload(sy... 阅读全文
posted @ 2016-01-20 11:26 gopher-lin 阅读(128) 评论(0) 推荐(0)
摘要: 激活虚拟环境 eval "$(pyenv init )" pyenv activate 阅读全文
posted @ 2016-01-18 17:43 gopher-lin 阅读(110) 评论(0) 推荐(0)
摘要: setup tools安装 curl https://bootstrap.pypa.io/ez_setup.py o | python mysqldb(mac) 建议版本选择1.2.3 https://pypi.python.org/pypi/MySQL python/ 先下载源码,修改site... 阅读全文
posted @ 2016-01-17 22:28 gopher-lin 阅读(129) 评论(0) 推荐(0)
摘要: coding:utf 8 import fileinput import os import repr ''' python 对文件的操作 ''' ''' 大小写转换 ''' def low_UPER(): oldNme='demo.txt' newName='my.txt' fp =... 阅读全文
posted @ 2016-01-14 17:02 gopher-lin 阅读(169) 评论(0) 推荐(0)
摘要: def low_UPER(): oldNme='demo.txt' newName='my.txt' fp = open(oldNme,"r+") newFp = open(newName,"w") for eachline in fp.readlines(): newStr = eac... 阅读全文
posted @ 2016-01-14 16:10 gopher-lin 阅读(349) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 16 下一页