scipy在misc的pilutil.py中def fromimage(im, flatten=0)函数中,# workaround for crash in PIL, see #1613.im.convert('L')上面是之前的代码,当图片模式是二值模式时,此处会出错,因为im.convert(...
分类:
编程语言 时间:
2014-08-29 10:33:57
阅读次数:
204
最近打算用 Python 来开发网站的一些其它功能,先来搭建 Python 的运行环境吧。安装 PythonPython 的目前有两个版本,Python 2.7.5 和 Python 3.3.2。Python 3.x 与 2.x 不仅仅是版本的新旧的区别那么简单,Python3.x 是一个全新的东西...
分类:
编程语言 时间:
2014-08-29 09:23:57
阅读次数:
244
1.一个简单的无参函数
#!/usr/bin/evnpython
#filename:function1.py
defsayHello():
print‘HelloWorld!‘
sayHello()
2.函数传参
#!/usr/bin/evnpyhon
#Filename:fun_param.py
defprintMax(a,b):
ifa>b:
printa,‘ismaxinum‘
else:
printb,‘ismaxinum‘
printMax(3,4)
x=5..
分类:
编程语言 时间:
2014-08-29 03:05:47
阅读次数:
283
1.for循环
#!/usr/bin/evnpython
#Filename:for.py
foriinrange(1,5):
printi
else:
print‘Theforloopisover‘
2.break语句
#!/usr/bin/evnpython
#filename:break.py
whileTrue:
s=raw_input(‘Entersomething:‘)
ifs==‘quit‘:
break
print‘Lengthofthestringis‘,len(s)
prin..
分类:
编程语言 时间:
2014-08-29 03:05:27
阅读次数:
230
依靠272的助攻374打进一球总比分锁定了欧冠zha...
分类:
其他好文 时间:
2014-08-29 02:52:56
阅读次数:
224
1.官网下载最新版本的cocos2d-js-rc2,解压之http://www.cocos2d-x.org/filedown/cocos2d-js-v3.0-rc2.zip2.如果没有安装python环境,需要安装python,推荐使用的版本为2.7python的官方网站:https://www.p...
分类:
Web程序 时间:
2014-08-29 01:19:06
阅读次数:
248
#!/usr/bin/env python# encoding: utf-8from optparse import OptionParserimport osimport reimport jsondef main(): try: parser = OptionParser(usage="%pro...
分类:
编程语言 时间:
2014-08-29 01:14:46
阅读次数:
338
Python中列表,字典和Set都有pop函数,但参数略有区别如下:以下参数基于Python 3.4.11. List1 >>> help(list.pop)2 Help on method_descriptor:3 4 pop(...)5 L.pop([index]) -> item --...
分类:
编程语言 时间:
2014-08-29 00:06:09
阅读次数:
567
yii CComponent组件 实例说明yii中的module,controller都是CComponent的子类,可以说yii的架构基石就是依托在CCompnent基础上的,这里研究下CComponent。另外写一个简单的组件应用示例。希望可以帮助到大家。component有三个基础特性,属性(...
分类:
其他好文 时间:
2014-08-29 00:02:36
阅读次数:
293