python

python2.6/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated from sets import ImmutableSet

Posted by bower on November 19, 2009
linux/ubuntu, python / No Comments

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

/var/lib/python-support/python2.6/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated from sets import ImmutableSet

Continue reading…

tornado-0.2 web server 实时服务器,下载,安装,hello world

Posted by bower on November 17, 2009
linux/ubuntu, python / No Comments

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tornado is an open source version of the scalable, non-blocking web server and tools that power FriendFeed. The FriendFeed application is written using a web framework that looks a bit like web.py or Google’s webapp, but with additional tools and optimizations to take advantage of the underlying non-blocking infrastructure.

Continue reading…

Tags: , , , ,

tornado documentation tornado web server文档, 翻墙所得

Posted by bower on November 17, 2009
linux/ubuntu, python / 1 Comment

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Go语言更名Issue 9?

Posted by bower on November 17, 2009
living on earth, python / No Comments

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Go语言更名Issue 9?

2009年11月13日 Continue reading…

python 复制,移动文件

Posted by bower on August 11, 2009
python / No Comments

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

import shutil
shutil.copyfile(‘data.db’, ‘archive.db’)
shutil.move(‘/build/executables’, ‘installdir’)

Continue reading…

python 星号

Posted by bower on August 10, 2009
python / No Comments

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

F(*arg1)
它以一个*加上形参名的方式来表示这个函数的实参个数不定,可能为0个也可能为n个。注意一点是,不管有多少个,在函数内部都被存放在以形参名为标识符的tuple中。
>>> def a(*x):
if len(x)==0:
print ‘None’
else:
print x
>>> a(1)
(1,)        #存放在元组中
>>> a()
None
>>> a(1,2,3)
(1, 2, 3)
>>> a(m=1,y=2,z=3)

Continue reading…

python 随机字符串 数字和字母混合任意个数

Posted by bower on August 05, 2009
python / No Comments

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

def getrandomstring(n):
basestring = ‘abcdefghijklmnopqrstuvwxyz1234567890_ABCDEFGHIJKLMNOPQRSTUVWXYZ’
basestring = basestring * 4
return string.join(random.sample(basestring, n)).replace(” “,”);

Continue reading…

python 随机数与随机字符串

Posted by bower on August 05, 2009
python / No Comments

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

随机整数:
>>> import random
>>> random.randint(0,99)
21

随机选取0到100间的偶数:
>>> import random
>>> random.randrange(0, 101, 2)
42

Continue reading…

python 除法

Posted by bower on August 05, 2009
python / No Comments

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

刚才写程序发现一个有趣的事,用python写了一个除法表达式,类似下面这个:
print 2/3
打印出的结果是0,而不是0.66666

Continue reading…

python time模块 格式化输出时间

Posted by bower on August 05, 2009
python / No Comments

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Our site dating website to meet realor in usa official website rencontrer femmes ukrainiennes femme cherche homme pour mariage ain temouchent published here dating site for retinitis pigmentosa http://www.aravit.co.uk/trening/3873 rencontre des filles en belgique cherryblossoms.com dating asian women.meet time.strftime(…)
strftime(format[, tuple]) -> string
将指定的struct_time(默认为当前时间),根据指定的格式化字符串输出
python中时间日期格式化符号:
%y 两位数的年份表示(00-99)
%Y 四位数的年份表示(000-9999)
%m 月份(01-12)
%d 月内中的一天(0-31)
%H 24小时制小时数(0-23)
%I 12小时制小时数(01-12)
%M 分钟数(00=59)
%S 秒(00-59)

Continue reading…

yum : Lock table is out of available locker entries 解决办法

Posted by bower on June 08, 2009
linux/ubuntu, python / No Comments

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

在用yum安装 mysqldb的时候 出现了错误

yum install MySQL-python (注意大小写)

error: Lock table is out of available locker entries

Continue reading…