Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : Python

¿´¿´Õâ¶ÎPython´úÂëÎÊÌâ³öÔÚÄÄ

ÕÕ×ÅÊéÉÏдµÄ£¬Ö´ÐÐʱ±¨´í£¨Python2.6£©
import wx
class InsertFrame(wx.Frame):
    def __init__(self,parent,id):
        wx.Frame.__init__(self,parent,id,'Frame With Button',size=(300,100))
        panel = wx.Panel(self)
  ......

python½Ì³ÌÖÐʹÓÃÔ´ÎļþµÄÎÊÌâ~~

ʹÓÃÔ´Îļþ

#!/usr/bin/python
# Filename : helloworld.py
print 'Hello World'

ÎÒÔõôҲ¿´²»¶®£¡Ö»ÊÇ×îºóÒ»ÐÐÎÒÖªµÀ~~Ç°ÃæÁ½ÐÐÊÇʲôÒâ˼ÄØ£¿
½Ì³ÌÉÏ˵Èç¹ûÄãʹÓÃIDLE£¬ÇëʹÓò˵¥Edit->Run Script»òÕßʹÓüüÅÌ¿ì½Ý·½Ê½Ctrl-F5
ÎÒÊÔ¹ýÁË
Á½ÖÖ·½·¨¶¼Ã»ÓÐÓÃ
Ç°Ò»ÖÖ EIDTÀï¸ù ......

[Ãâ·Ñ·ÖÏí]Let's PythonÊÓƵµÚ¶þ¼¯·¢²¼, ¿ÉÎȶ¨ÏÂÔØ.

ϲ»¶PythonµÄÅóÓÑÇë½ø.
ÏêϸÐÅÏ¢Çë²é¿´:
http://blog.csdn.net/lgg201/archive/2009/10/08/4643635.aspx

  Let's-python-ϵÁÐÊÓƵ·¢²¼×¨Ìù ÊÕ²Ø
ÊÓƵ½ÏÔçµÄʱºò¾Í˵ÊÇҪ¼ÁË, ÕâÒ»ÖܼÁ˵ÚÒ»¼¯, ÓÉÓÚµÚÒ»´Î¼ÊÓƵ, ¼µÄÎļþÌ«´óÁË, 800¶àM, ×îºóÖ»ºÃµ¥¶ÀѹËõÒ»¸öflash, ÏÖÔÚÉÏ´«µ½ÁËQQµÄÎļþÖÐ× ......

µÚÒ»´ÎÓÃPythonд³ÌÐò£¬Ê¹ÓÃfindº¯ÊýÓöµ½Ò»¸öÎÊÌâ

//ÏÂÃæµÄ´úÂëÔËÐÐÕý³£

tomstrs=re.findall(......)
mtxx=''
for tomstr in tomstrs:
  tomstr=tomstr.strip()
  if  tomstr:
      mtxx += tomstr
print mtxx 

#print³öÀ´µÄ½á¹ûÕý³£


//Èç¹ûÎÒÔÚÉÏÃæµÄ´úÂëÖмÓÒ»ÐÐ

tom ......

PythonÖÐÎÄ´¦Àí£¬Íê³É¹¦ÄܵÄʵÓû¯

±¾ÎÄÕª×Ô¡¶¿É°®µÄPython¡·¡°¹âÅ̹ÊÊ¡±CDay-1 ʵÓû¯ÖÐÎÄ¡£
[img]http://t.douban.com/mpic/s3901817.jpg[/img]
CDay-1 ʵÓû¯ÖÐÎÄÖÐÎÄ´¦Àí£¬Íê³É¹¦ÄܵÄʵÓû¯
ÄãÅöµ½99%µÄÎÊÌ⣬ÆäËûÈË֮ǰÒѾ­Óöµ½¹ýÁË£¬ËùÒÔ£¬×î¼ÑµÄ½â¾ö·½Ê½¾ÍÊÇÕÒµ½ÄǶαðÈ˽â¾öÏàËÆÎÊÌâµÄ´úÂ룡
»Ø¹ËÐèÇóС°×ÒѾ­ÊµÏÖµÄÐèÇó¿ÉÒÔʵÏÖÈçϹ¦Ä ......

Ë­Óùýpython µÄmock ×öunit test

Èç¹ûÒ»¶Î´úÂë

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()
return res
except URLError, e:
if hasattr(e, 'reason'):
return('We failed to reac ......
×ܼǼÊý:175; ×ÜÒ³Êý:30; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [19] [20] [21] [22] 23 [24] [25] [26] [27] [28]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ