Python很好很强大
30
Oct.2019
for i in range(100):
print "%02d" % i
00
01
02
03
04
05
06
07
08
...
99
0为占位符 2为共几位,不足的前面补0,
例如: %05d
输出: 00001 00099 09999 这样的五位数
15
Jan.2015
6
Nov.2012
当有人问你昨天是几号,是不是很容易就得到答案了,
但是当问你100天前是几号,你是不是又能很容易地得出答案呢?
呵呵,让我们用程序来实现一下吧,datetime的timedeltime就派上用场了。
import datetime
(datetime.datetime.now() - datetime.timedelta(days = 100)).strftime("%Y-%m-%d")
是不是很方便呢?!
但是当问你100天前是几号,你是不是又能很容易地得出答案呢?
呵呵,让我们用程序来实现一下吧,datetime的timedeltime就派上用场了。
import datetime
(datetime.datetime.now() - datetime.timedelta(days = 100)).strftime("%Y-%m-%d")
是不是很方便呢?!
19
Aug.2011
非官方的Windows二进制文件的Python扩展包
Unofficial Windows Binaries for Python Extension Packages
by Christoph Gohlke, Laboratory for Fluorescence Dynamics, University of California, Irvine.
这个地址很好,好多资源都有,很全。这回不用为sourceforge.net不能访问而苦恼了。
Unofficial Windows Binaries for Python Extension Packages
http://www.lfd.uci.edu/~gohlke/pythonlibs/
Unofficial Windows Binaries for Python Extension Packages
by Christoph Gohlke, Laboratory for Fluorescence Dynamics, University of California, Irvine.
这个地址很好,好多资源都有,很全。这回不用为sourceforge.net不能访问而苦恼了。
Unofficial Windows Binaries for Python Extension Packages
http://www.lfd.uci.edu/~gohlke/pythonlibs/
19
Aug.2011
使用ActivePython-2.7.2.5-win32-x86搭建python+django环境,在virtualenv安装PIL的时候出错,提示Unable to find vcvarsall.bat,搜索其原因可能是因为python是调用c,需要C的脚本来编译python包,网上有两种解决方法,
24
Jun.2011
python学习记录:
引自:啄木鸟社区 http://wiki.woodpecker.org.cn/moin/MiscItems/2011-06-16
问题:
2011/6/16 cougar cougar
> 知道历史上某个时间,比如:2008-08
> 得到目前2011-06之间年号和月份的列表
> 2008-08
> 2008-09
> 。。。
> 。。。
> 2011-05
> 2011-06
> 列表解析还是for?
>
引自:啄木鸟社区 http://wiki.woodpecker.org.cn/moin/MiscItems/2011-06-16
问题:
2011/6/16 cougar cougar
> 知道历史上某个时间,比如:2008-08
> 得到目前2011-06之间年号和月份的列表
> 2008-08
> 2008-09
> 。。。
> 。。。
> 2011-05
> 2011-06
> 列表解析还是for?
>
21
Jun.2011
来源:http://blog.chinaunix.net/space.php?uid=374372&do=blog&cuid=2201784 冰雪塵埃
Python中的easy_install工具很爽,它的作用类似于Php中的pear,或者Ruby中的gem,或者Perl中的cpan。
如果想使用easy_install工具,可能需要先安装setuptools,不过更酷的方法是使用ez_setup.py脚本:
wget -q http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
Python中的easy_install工具很爽,它的作用类似于Php中的pear,或者Ruby中的gem,或者Perl中的cpan。
如果想使用easy_install工具,可能需要先安装setuptools,不过更酷的方法是使用ez_setup.py脚本:
wget -q http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py