ÇëÎÊpythonÀïÃæµÄ@ʲôÒâ˼£¿
±ÈÈç
Python code:
@orm.validates('title')
def validate_title(self, key, title):
"""Assure that page titles are wikiwords and valid length"""
if len(title) > 40:
raise ValueError('Page title must be 40 characters or fewer')
if not wikiwords.match(title):
log.warning('%s: invalid title (%s)' % (self.__class__.__name__,
title))
raise ValueError('Page title must be a wikiword (CamelCase)')
return title
¸Ðл¡«
Ïà¹ØÎÊ´ð£º
a.xmlÄÚÈÝÈçÏÂ:
</project>
<project name="asdf" branch="asfasdfas" naname="xiao xin" QD6="091010">
<compo ......
¸Õ¸Õ¿ªÊ¼Ñ§python Çë½ÌÒ»¸öÎÊÌâ:
ÓÃ def n in range(100):
¿ªÊ¼Ñ»·
Óà % ·½·¨À´ÅÐ¶Ï ÖÆÑ»·4´Î¾Í ´òÓ¡ '*' * 25¸ö .
лл!ÔÚÏßµÈ....
for i in range(100):
if i%4 == 0:
......
ʹÓÃÔ´Îļþ
#!/usr/bin/python
# Filename : helloworld.py
print 'Hello World'
ÎÒÔõôҲ¿´²»¶®£¡Ö»ÊÇ×îºóÒ»ÐÐÎÒÖªµÀ~~Ç°ÃæÁ½ÐÐÊÇʲôÒâË¼ÄØ£¿
½Ì³ÌÉÏ˵Èç¹ûÄãʹÓÃIDLE£¬ÇëʹÓò˵ ......
//ÏÂÃæµÄ´úÂëÔËÐÐÕý³£
tomstrs=re.findall(......)
mtxx=''
for tomstr in tomstrs:
tomstr=tomstr.strip()
if tomstr:
mtxx += tomstr ......