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

°²×°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(


Ïà¹ØÎĵµ£º

¶¯Ì¬´ó±ÈÆ´Python¡¢LuaºÍRuby


ÀµÓºÆ(http://blog.csdn.net/lanphaday) Òë
ÒëÕß°´£ºPython¡¢luaºÍrubyÔÚC/C++ÊÇÈÕ½¥Ê½Î¢µÄÇé¿öÏ£¬ÔÚjava/.netµÄΧ¼ßÖÐŬÁ¦¿¹ÕùµÄÈý¸öµ±ºìСÉú¡£ÔÚTom GutschmidtµÄÖø×÷¡¶Game Programmng with Python, Lua and Ruby¡·Ò»ÊéÖУ¬½éÉÜÁËÈýÖÖÓïÑÔÔÚÓÎÏ·ÖеÄÓ¦Óã¬ÆäÖÐÓÈΪÁ˲»ÆðµÄÊÇÔÚÊéÖÐ×îºóÒ»ÕÂÖбȽÏÁËÈýÖֽű¾£¬×÷Õßà ......

RubyºÍPythonµÄÓï·¨±È½Ï


RubyºÍPythonµÄÓï·¨±È½Ï
 
 
 
ÆäʵRubyºÍPython·Ç³£½Ó½ü£¬±È´ó¶àÊý±ðµÄÓïÑÔÒª½Ó½üµÄ¶à£¬ËùÒÔϲ»¶ÓÃɶ¾ÍÓÃɶ£¨´óʵ»°£¬ËäȻҲÊÇ·Ï»°£©¡£Óï·¨ÉϵIJî±ðËäÈ»ÓÐÄÇôһµã£¬´ó²¿·ÖÊÇsyntax sugar£¬ÎÒ¶·µ¨ÉÔ΢Áм¸¸ö£¨pythonÎÒÒ²ÍüµÃ²î²»¶àÁË£¬²»¶ÔµÄ´ó¼Ò¾¡¹ÜÀ´±Þʬ°É£©£¬µ«ÊÇÖ÷Òª²îÒ컹ÊÇÉè¼Æ˼ÏëÉϵģºÁé»î ......

¼ò»¯Python½âÊÍ»·¾³µÄ°²×°

ÎÊÌâÃèÊö
ÔÚC++ºÍPython»ìºÏ±à³ÌÖУ¬ÔÚÈí¼þ·¢²¼µÄʱºòÐèÒª½«pythonµÄ½âÊÍÆ÷´ò°üµ½°²×°³ÌÐòÖУ¬ÎªÁËÌá¸ßÓû§ÌåÑ飬ÎÒÃÇÐèÒªÈÃÓû§¸Ð¾õ²»µ½pythonµÄ°²×°£¬Èç¹ûÓû§ÒѾ­°²×°ÓÐpythonµÄ»·¾³£¬ÎÒÃÇÒ²Òª±£Ö¤²»Ó°ÏìÏÖÓеÄϵͳ¡£
½â¾ö·½°¸
ÔÚPython2.5ÒÔºó£¬pythonÖ§³Ö´ÓzipÎļþÖжÁÈ¡python½Å±¾Îļþ£¬Ö§³Ö¶ÁÈ¡py£¬pyc£¬pyo£¬²»Ö ......

pythonµÄÒì³£Exception


Python µÄÒì³£´¦Àí»úÖÆ
Python´úÂë 
 try:    
  raise Exception("a", "b")    
    except Exception,e:    
  print e    
    finally:    
  print "final"    
('a', ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ