ÇëÎÊ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
¸Ðл¡«
Ïà¹ØÎÊ´ð£º
ÎÒÓÃÁËdef CreateMyDialog(self):
dlg = MyDialog(None, -1, ''.decode('utf8'), (300,300), (300,200), wx.DEFAULT_DIALOG_STYLE | wx.DIALOG_NO_PARENT )
&nbs ......
ÎÒĿǰµÄÖ÷¹¥ÓïÑÔÊÇ.NET£¬ÏëѧPYTHON£¬¿´ÁËһЩ¼òµ¥µÄ¹ØÓÚpythonµÄ×ÊÁÏ£¬µ«¸Ð¾õ·Ïß²»¶Ô£¬ÏëÇëÅ£ÈËÖ¸µãÏ£º
1.ÈçºÎÈëÃÅ£¬Ä¿Ç°ÒÑÊìÁ·ÕÆÎÕC#ÓïÑÔ£¬ÆäËûÓïÑÔÊìϤµÄÒ²²»ÉÙ£¨Èçjavascript)£¬ÓкõĽ̳Ìû£¬ÓÐÏà¹ØÍ ......
pythonºÍpyqtÒÔ¼°Eric4¶¼ÒѾÅäÖúÃÁË£¬´ò¿ªEric4д¸öpython³ÌÐò±ÈÈç¼òµ¥µÄ
print¡°hello£¬world¡±£¬Ôõô±àÒëÔËÐÐÁË£¬Start²Ëµ¥µÄËùÓÐÃüÁî¶¼³öÏÖºÍͼÖв¶àµÄ¶Ô»°¿ò£¬Ó¦µ±ÔõôÔËÐÐÁË£¿
Çó´ó¼ÒÖ¸½Ì
ûÓÐÈËÓà ......
//ÏÂÃæµÄ´úÂëÔËÐÐÕý³£
tomstrs=re.findall(......)
mtxx=''
for tomstr in tomstrs:
tomstr=tomstr.strip()
if tomstr:
mtxx += tomstr ......
Èç¹ûÒ»¶Î´úÂë
Python code:
#!/usr/bin/python2.5
from urllib2 import Request,urlopen,URLError
def check():
req = Request('http://www.google.com')
try:
res = urlopen(req).read()
......