码迷,mamicode.com
首页 >  
搜索关键字:python function    ( 188437个结果)
自己写了一个类(serialize 和 unserialize)
name = $in_name; $this->age = $in_age; $this->owner = $in_owner; } function getage() { return ($this->age * 365); } f...
分类:其他好文   时间:2014-05-08 12:36:51    阅读次数:336
python 向上取整ceil 向下取整floor 四舍五入round
#encoding:utf-8import math#向上取整print "math.ceil---"print "math.ceil(2.3) => ", math.ceil(2.3)print "math.ceil(2.6) => ", math.ceil(2.6)#向下取整print "\nm...
分类:编程语言   时间:2014-05-08 12:11:13    阅读次数:467
细学设计模式一(组合与继承)
1 duration = $duration;10 $this->costtype = $costtype;11 }12 13 function cost(){14 switch ($this->costtype){15 ...
分类:其他好文   时间:2014-05-08 12:02:21    阅读次数:190
转载Python中__getattr__ __getattribute__ __get__解释
来源:http://www.myexception.cn/perl-python/620096.htmlpython中__get__,__getattr__,__getattribute__的区别__get__,__getattr__和__getattribute都是访问属性的方法,但不太相同。ob...
分类:编程语言   时间:2014-05-08 11:51:14    阅读次数:277
python2.7.3 problem:no module name _ssl
本文章參考與:http://www.webtop.com.au/blog/compiling-python-with-ssl-support-fedora-10-2009020237。當我"修"好yum之後就開始修python的ssl問題。我的電腦有python的多個版本。在python2.6.6中...
分类:编程语言   时间:2014-05-08 11:46:52    阅读次数:507
安装node hyperdex扩展
python 2.6+1. 先安装nodejs2. 安装hyperdex 默认安装即可,默认都是enable = yes3. 给node添加node-gyp npm install -g node-gyp, 全局安装。 参考:https://www.npmjs.org/package/node...
分类:其他好文   时间:2014-05-08 11:46:20    阅读次数:301
转载python描述符介绍
来源:http://www.ibm.com/developerworks/cn/opensource/os-pythondescriptors/简介Python 2.2引进了Python描述符,同时还引进了一些新的样式类,但是它们并没有得到广泛使用。Python描述符是一种创建托管属性的方法。除了其...
分类:编程语言   时间:2014-05-08 11:38:39    阅读次数:420
ie8、firfox关于(new Image()).onload的问题
如果要获取一张图片原本的高度和宽度,我们一般这样获取var url = "../images/1.jpg";var img = new Image();img.src = url;img.onload = function(){ //do something.....}当图片从服务器传到本来(也即....
分类:其他好文   时间:2014-05-08 11:23:03    阅读次数:358
Sphinx 配置文件的说明【备忘】
## 数据源src1source src1{ ## 说明数据源的类型。数据源的类型可以是:mysql,pgsql,mssql,xmlpipe,odbc,python ## 有人会奇怪,python是一种语言怎么可以成为数据源呢? ## python作为一种语言,可以操作任意其他的数...
分类:其他好文   时间:2014-05-08 11:22:38    阅读次数:398
Windows7下python2.7.6环境变量配置
默认情况下,在windows7下安装python2.7.6之后,系统并不会自动添加相应的环境变量。此时不能在命令行直接使用python命令。1. 首先需要在系统中注册python环境变量: 假设python的安装路径为c:\Python27, 则 计算机->属性->高级系统设置->高级...
分类:编程语言   时间:2014-05-08 10:28:14    阅读次数:412
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!