°²×°Memcached For Win32 ºÍ Memcached Python Client
Memcached
ÊÇdanga.com£¨ÔËÓªLiveJournalµÄ¼¼ÊõÍŶӣ©¿ª·¢µÄÒ»Ì×·Ö²¼Ê½ÄÚ´æ¶ÔÏ󻺴æϵͳ£¬ÓÃÓÚÔÚ¶¯Ì¬ÏµÍ³ÖмõÉÙÊý¾Ý¿â¸ºÔØ£¬ÌáÉýÐÔÄÜ¡£
ÍøÉÏÓкིܶµ½Memcached For LinuxµÄ°²×°½Ì³Ì£¬µ«ÊÇMemcached For Win32 and PythonµÄ¾ÍÉõÉÙ£¬Å¼¶ûgoogleÕÒµ½Ò»Æª
±È½ÏÏà½üµÄÓ¢ÎĽ̳̣¬¾õµÃºÜ²»´í¾Í´òËã·ÒëÏÂÀ´£¬²¢ÇÒдһ¸öHello WorldµÄmemcachedʵÀý¡£
°²×°²¿·ÖÀ´×ÔÔÎÄ
1.ÏÂÔØmemcached 1.2.1 for Win32
.
2.°Ñmemcached-1.2.1-win32.zip½â°üµ½ÄãÏëÒªµÄ·¾¶ÏÂ
(Èç:C:\memcached-1.2.1-win32)
3.´ò¿ªÃüÁîÐÐ(ÔÚ¿ªÊ¼²Ëµ¥ÖеÄ"ÔËÐÐ"£¬ÊäÈë"cmd")£¬Ê¹ÓÃÒÔϵÄÃüÁî°²×°:
C:\memcached-1.2.1-win32\memcached.exe -d install
°²×°Íê³ÉÖ®ºó£¬ÔÙÖ´ÐÐÒÔÏÂÃüÁîÀ´Æô¶¯memcached:
C:\memcached-1.2.1-win32\memcached.exe -d start
ÕâÑùmemcached»áʹÓÃĬÈϵĶ˿Ú(11211)À´Æô¶¯£¬Æô¶¯³É¹¦µÄ»°£¬Äã¿ÉÒÔÔÚÈÎÎñ¹ÜÀíÆ÷Öп´µ½memcached.exe
4.ΪÁ˺ÍmemcachedͨÐÅ£¬ÄãÐèÒª°²×°Ò»¸ömemcached¿Í»§¶Ë
£¬À´¶Ômemcached×ö“Ôöɾ¸Ä”²Ù×÷¡£memcachedÓкܶà¸ö¿Í»§
¶Ë³ÌÐò¿ÉÒÔʹÓ㬶ÔÓ¦ÓÚ¸÷ÖÖÓïÑÔ£¬Óи÷ÖÖÓïÑԵĿͻ§¶Ë¡£»ùÓÚCÓïÑÔµÄÓÐlibmemcache¡¢ APR_Memcache£»»ùÓÚPerlµÄÓÐCache::Memcached£»ÁíÍ⻹ÓÐPhp¡¢Python¡¢Ruby¡¢Java¡¢C#µÈÓïÑÔµÄÖ§³Ö¡£ÆäÖÐPHPµÄ¿Í»§¶ËÊÇ×î¶àµÄ£¬Äã¿ÉÒÔÔÚÍøÉÏËÑ
Ë÷µ½´ó²¿·Ö£¬ÕâÀïÎÒÖ»½éÉÜpythonµÄ¿Í»§¶Ë¡£
5.»ñÈ¡×îаæµÄmemcached python¿Í»§¶Ë£ºpython-memcached-latest.tar.gz
6.°Ñpython-memcached-latest.tar.gz½âѹµ½ÈÎÒâ·¾¶
(Èçc:\python-memcached-1.45)
7.ÔÚÃüÁîÐÐÖÐcdµ½c:\python-memcached-1.45Ŀ¼ÏÂ:
cd c:\python-memcached-1.45
8.È»ºóÔËÐÐÒÔÏÂÃüÁî°²×°python-memcached:
python setup.py build
python setup.py install
ÕâÑùpython-memcached¾Í³É¹¦°²×°µ½python¿âÖС£Èç¹ûÌáʾImportError: No module named setuptools
£¬ÇëÏÈ°²×°
setuptools for win32
¡£
9.ÔËÐÐÒÔÏ´úÂëÀ´²âÊÔpython-memcachedÊÇ·ñ³É¹¦°²×°
import memcache
#´´½¨Á¬½Ó
mc_client = memcache.Client(['127.0.0.1:11211'], debug=0)
#д¡¢¶Á
mc_client.set("key_a", "value_a")
value = mc_client.get("key_a")
print "key_a 's value in memcached is: %s" %(value)
#ɾ
mc_client.delete(
Ïà¹ØÎĵµ£º
1)Excel hyperlink:
xlsApp = win32com.client.Dispatch('Excel.Application')
cell = xls.App.ActiveSheet.Cells(1,1)
cell.Hyperlink.Add(cell,'http://xxx')
2)Excel row/column count:
sht = xlsApp.ActiveSheet
sht.Columns.Areas.Count
sht.Rows.Areas.Count
*************************
£Û1£ÝʹÓÃPyExcelera ......
http://bbs.chinaunix.net/thread-1586782-1-1.html
ÎÒ¸Õ¸ÕÓÃpythonдÁËÒ»¶Î²Ù×÷excelµÄ½Å±¾£¬Ä¿µÄÊÇ°ÑÒ»¸öexcelÎļþ°´ÕÕijһÁÐÖеÄ×ֶβð·Ö³É¶à¸öÎļþ£¬ÀýÈç°´ÕÕ³ÇÊлòÕßÊ¡·ÝµÈ£¬µ«ÊÇ·¢ÏÖ´¦ÀíÒ»¸ö1700ÐеÄÎļþ²ð·Ö³É40¶à¸öÎļþʱҪÔËÐÐ30·ÖÖÓ×óÓÒ£¬ÐÔÄÜÌ«Âý£¬Çë¸ßÊÖ°ïæ¿´¿´Ôõô²ÅÄÜÓÅ»¯ÐÔÄÜ£¬Ð»Ð»¡£
ÐÂÊÖдµÄ½Å±¾£¬Çë²» ......
ÆäʵÒì³£¾ÍÊDz»Õý³££¬¾ÍÊDz»ºÍÎÒÃÇÏëÏóÒ»ÑùÈ¥Ö´ÐС£ËüÊÇÒòΪ³ÌÐò³öÏÖÁË´íÎó¶øÔÚÕý³£¿ØÖÆÁ÷ÒÔÍâ²ÉÈ¡µÄÐÐΪ¡£Python³öÏÖÒì³££¬¾ÍÊÇÒòΪ¼ì²éÁËÒ»¸ö´íÎóʱ£¬Python½âÊÍÆ÷ÎÞ·¨¼ÌÐø¼ÌÐøÖ´ÐÐÏÂÈ¥£¬ÕâʱºòÅ׳öÁËÒì³£¡£ÍùÍùÕâ¸ö´íÎó·ÖΪÓï·¨ÉϺÍÂß¼ÉÏ(²»Éó¤Ëµ¸ÅÄ-_-! )£¬¿´¿´¼¸¸öÀý×Ó£¬×ܽáһϣº
1¡¢NameError£º³¢ÊÔ·ÃÎÊÒ»¸öÎ ......
def getText(self,nodelist):
rc=""
for node in nodelist:
if node.nodeType == node.TEXT_NODE or node.nodeType == node.CDATA_SECTION_NODE:
rc = rc + node.data
return rc
def parseXML(self,requesturl,xml):
dom = minidom.parse(requesturl)
for node in dom.getElementsByTagName('ca ......