Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÓÃPythonʵÏÖÍøÕ¾²âÊÔ

²âÊÔÍøÕ¾£ºBaiduÖ÷Ò³ÒÔ¼°Ïà¹ØµÄÒ³Ãæ
Ö÷Ì⣺ºÚºÐ²âÊÔ£¬¹¦ÄܲâÊÔ£¬ÐÔÄÜ/ѹÁ¦²âÊÔ£¬°²È«²âÊÔ£¬ Êý¾Ý×Öµä¹ÜÀí
1. ²âÊÔÒ³ÃæÊÇ·ñ¿É·ÃÎʵģ»
1.1 HTTP request status = 200, Ò³ÃæÏÂÔØÕýÈ·
from urllib import urlopen
# set up
url = None
# test
url = urlopen('http://www.baidu.com')
assert url.getcode() == 200
# clean up
del url
1.2 ÏÂÃ濼ÂǸü¶àµÄ²âÊԵ㣬±ÈÈç¸÷ÖÖURL£¬¶Ë¿Ú£¬´úÀí£¬RequestÊý¾ÝÒÔ¼°Cookie.
¸ù¾ÝÍøÒ³µÄÁé»îÐÔ£¬ÎÒÃÇÑ¡Ôñ±È½Ï¼Ç¼Ðεķ½·¨À´ÊµÏÖ²âÊÔ¹¦ÄÜ£¬ÀàËÆLoadRunnerÖ»Êǽű¾ÊÇ×Ô¼ºÊÖд¡£
2. ²âÊÔÒ³ÃæµÄ¹¦ÄÜÊÇ·ñ·ûºÏÒªÇó: ÒԵǽ£¬·¢±íÎÄÕÂΪÀý
3. ²âÊÔÒ³ÃæµÄÐÔÄÜÊÇ·ñ·ûºÏÒªÇó£º
    ²¢·¢Óû§ÊýÁ¿£¬ÇëÇóÏìӦʱ¼ä£¬ÊÂÎñÇëÇóÏìӦʱ¼ä£¬£¨ÍÌÍÂÂÊ£¬ TPS£¬×ÊÔ´ÀûÓÃÂÊ ÎÞ·¨·ÃÎÊ·þÎñÆ÷)£¬ µã»÷ÂÊ
4. ²âÊÔÒ³ÃæÔÚÓû§²Ù×÷ºÍÍþвÏÂÊÇ·ñ°²È«£º
    Cookie¹¥»÷£¬SQL×¢Èë¹¥»÷£¬ä¯ÀÀÆ÷¹¥»÷£¬±©Á¦¹¥»÷£¬ÊäÈë·Ç·¨Êý¾Ý£¬ÉÏ´«·Ç·¨Îļþ£¬Õ¾Íâ½Å±¾¹¥»÷£¬Ä¾Âí¼ì²é


Ïà¹ØÎĵµ£º

Python Á·Ï°2

Éú³ÉÒ»¸öÓÐN¸öÔªËصÄÓÐËæ»úÕûÊýn×é³ÉµÄÁÐ±í£¬ÆäÖÐNºÍÄêµÄÈ¡Öµ·¶Î§ÊÇ£¨1<N<=5£©
ºÍ(0<=n<100)£¬ÏÔʾÕâ¸öÁбíµÄËùÓÐ×Ó¼¯¡£
N¸öÊý×Ö¿ÕÓÐ2en¸ö×Ó¼¯£¬¶ÔÓÚÕâN¸öÊý×ÖÔÚÿ¸ö×Ó¼¯ÖÐÀ´½²ÒªÃ´´æÔÚҪô²»´æÔÚ£¬¿ÉÒÔ²ÉÓÃ×Ó¼¯Ó³ÉäΪ2½øÖƵÄËã·¨¡£
ÀýÈç[a,b]¼¯ºÏµÄ×Ó¼¯£º
¿Õ      ---- &nb ......

pythonϵÄweb¿ª·¢¿ò¼Ü Django,´´½¨ÏîÄ¿

½âѹdjango£¬È»ºóµ½ÆäĿ¼Ï°²×°
Ç°ÌáÊÇÄã°²×°ºÃpython.²¢½«ÆäÅäÖõ½»·¾³±äÁ¿ÖУ¬È»ºóÈ¥djangoµÄѹËõÎÄÐÞµÄÏ£¬Ö´ÐÐÒÔϵ¹ÃüÁî
python setup.py install
1.´´½¨project
Ê×ÏÈÎÒÃÇ´ò¿ªcmd, ¶¨Î»µ½Ï£Íûн¨¹¤³ÌµÄĿ¼ÏÂ, ÈÎÒâĿ¼¾ù¿É. È»ºó¼üÈëÈçÏÂÃüÁî:
django-admin.py startproject helloÆäÖÐhelloΪй¤³ÌĿ¼ÎļþÃû ......

PythonÈÕÆÚºÍ×Ö·û´®µÄ»¥×ª

ÓõķֱðÊÇtimeºÍdatetimeº¯Êý
'''
Created on 2009-9-2
@author: jiangqh
'''
import time,datetime
# date to str
print time.strftime("%Y-%m-%d %X", time.localtime())
#str to date
t = time.strptime("2009 - 08 - 08", "%Y - %m - %d")
y,m,d = t[0:3]
print datetime.datetime(y,m,d)

Êä³öµ±Ç°Ê±¼ä ......

beginning python summary chapter 4 ×Öµä

1¡¢PythonÖ®ÖÐΨһÄÚ½¨µÄÓ³ÉäÀàÐ;ÍÊÇ×ֵ䣨Dictionary£©¡£×ÖµäÖеÄÖµ²¢Ã»ÓÐÌØÊâµÄ˳Ðò£¬µ«ÊǶ¼°´Õչؼü×Ö£¨Key£©½øÐд洢£¬¹Ø¼ü×Ö¿ÉÒÔÊÇÊý×Ö¡¢×Ö·û´®£¬ÉõÖÁÊÇÔª×飨Tuple£©¡£
2¡¢×ÖµäµÄÓï·¨£º×ÖµäÃû = {'¼ükeys':'Öµvaules','¼ükeys':'Öµvaules','¼ükeys':'Öµvaules',...}£¬×ÖµäÖаüº¬ºÜ¶à¶Ô£¨³ÆΪÌõÄ¿items£©£¬ÓÉ£¨keys£ ......

ת¶ÎPython´úÂë

#==================================================
import wx
import wx.media

class MyFrame(wx.Frame):
def __init__(self,parent,title):
wx.Frame.__init__(self,parent,-1,title,pos=(150,150),size&;nbsp;=(640, 480),style=wx.MAXIMIZE_BOX|wx.SYSTEM_MENU|wx.CAPTION|wx.CLOSE_BOX| ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ