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

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


RubyºÍPythonµÄÓï·¨±È½Ï
 
 
 
ÆäʵRubyºÍPython·Ç³£½Ó½ü£¬±È´ó¶àÊý±ðµÄÓïÑÔÒª½Ó½üµÄ¶à£¬ËùÒÔϲ»¶ÓÃɶ¾ÍÓÃɶ£¨´óʵ»°£¬ËäȻҲÊÇ·Ï»°£©¡£Óï·¨ÉϵIJî±ðËäÈ»ÓÐÄÇôһµã£¬´ó²¿·ÖÊÇsyntax sugar£¬ÎÒ¶·µ¨ÉÔ΢Áм¸¸ö£¨pythonÎÒÒ²ÍüµÃ²î²»¶àÁË£¬²»¶ÔµÄ´ó¼Ò¾¡¹ÜÀ´±Þʬ°É£©£¬µ«ÊÇÖ÷Òª²îÒ컹ÊÇÉè¼Æ˼ÏëÉϵģºÁé»îvsÃ÷È·. ÎÒ²»ÈÏΪÁ½ÕßÔÚÉú²úÁ¦ÉÏ»áÓÐʲô²î±ð£¬Èç¹ûÄãÊìϤµÄ»°¡£*×¢Ò⣬½öÏÞÓïÑÔ±¾ÉíµÄ±È½Ï¡£
±¾ÎÄÍƼö£ºRubyÈëÃŽ̳ÌÓë¼¼ÇÉ´óÈ«
RubyºÍPythonµÄ±È½ÏÁбí
1. rubyµÄcase¿ÉÒÔÆ¥ÅäºÜ¶à¶«Î÷£º·¶Î§/Êý×飬¶ÔÏó£¬ÕýÔò±í´ï£¬pythonûÓÐcase/switch¶øʹÓÃif/else±È½ÏËÀ°åµã
2. pythonµÄËõ½øºÜƯÁÁ£¬ËäÈ»ÓÐʱ»áÔì³ÉЩÐíÂé·³¡£rubyµÄendÂùÄÑ¿´µÄ£¬ËùÒÔ´ó¼Ò¶¼±»±Æµ±one liner£¨ÍæЦ£©
3. ¸Ð¾õÉÏruby±Èpython¸üOO,µ±È»ÕâÒ²¿ÉÄÜÊÇÒòΪpython²»ÌᳫÓÃÄÇЩ¸Ä±ä¶ÔÏóÄÚ²¿¹¹ÔìµÄ‘¼¿Á©’Ôì³ÉµÄ´í¾õ
4. pythonÓÐlist comprehension, rubyûÓÐ:(
5. pythonÓÐÕæÕýµÄkeyword argument, rubyÓÃhashÄ£Ä⣬µ±È»Êµ¼ÊÓÃÆðÀ´Ã»Ê²Ã´²î±ð
6. pythonµÄselfºÜÌÖÑᣬrubyûÓÐÄÇÖÖ·±ËöµÄ¶«Î÷
7. reflection£¬rubyÄÚÖÃÁ˺ܶ෽·¨£¬±ÈÈçobject.methods£¬¶øpython°ÑÕâЩÐÅÏ¢´æÔÚÌØÊâµÄ×ÖµäÀï¡£²î²»¶à
8. rubyµÄblock¹¦ÄܺÜÇ¿£¬pythonµÄlambdaÖ»ÄÜ·µ»Øµ¥Ò»Öµ
9. rubyµÄopen classÒѾ­ÉùÃ÷Ô¶²¥£¬¿ÉÒÔÍæ³ö2.days.agoÕâÑùµÄ»¨Ñù£¬pythonºÃÏñû·¨Ö±½ÓÐÞ¸ÄÄÚÖÃÀàÒ²·´¶ÔÕâô×ö¡£
10. pythonÐèÒªÓÃ@classmethodÐÞÊÎÉùÃ÷Àà·½·¨£¬rubyÊÇÄÚ½¨
11. rubyÓе¥×Ó·½·¨£¬Ò²¾Í¶Ô¶ÔÏ󵥶À¶¨ÖÆ£¬python²»ÖªµÀÓÐûÓÐÀàËƸÅÄî
12. rubyÓÐmethod_missing»úÖÆ£¬python¿ÉÒÔʹÓÃ__getattr__½Ø»ñ䶨Òå·½·¨(from qiezi)
13. rubyʹÓõ¥¼Ì³Ð+mixin£¬pythonʹÓöàÖؼ̳У¬²»¹ýpythonÒ²ÓÐmixin
14. rubyÓÐattr_*ϵÁÐÓï·¨helper£¬Ê¡È´×Ô¼ºÐ´Ò»¶Ñsetter/getter, pythonµÄproperty·½·¨»¹ÊǵÃ×Ô¼ºÐ´setter/getter
15. rubyºÍpython¶¼Ê¹ÓÃduck typing£¬²»¹ýpythonÒ²ÓÐÒ»Ì×ÏÔʽµÄinterface»úÖÆ(´Ózope3²¢ÈëÄÚºËÁËô£¿)
16. rubyµÄº¯Êýµ÷ÓÃÀ¨ºÅÊÇ¿ÉÊ¡µÄ£¬ÉÔ΢ÉÙÇü¸Ï¼üÅÌ¡£pythonĬÈÏûÀ¨ºÅÒ²²»´ø²ÎÊýµÄ»°·µ»Øº¯Êý±¾ÉíµÄÒ»¸öÒýÓá£
17. ÎÒ²»Çå³þpythonµÄmeta programmingÄܵ½Ê²Ã´³Ì¶È£¬Ö»ºÃµÈ´óÅ£À´ËµËµÁË¡£Ö»ÊǾõµÃpythoner²»³£ÓÃÄǸö£¬Ò²Ðí¾õµÃ»á°Ñ³ÌÐòÂß¼­¸ãµÃ»Þɬ²»Ã÷¡£
18. ruby´Óperl¼Ì³ÐÁËÒ»²¿·ÖÄÑ¿´µÄ¶«Î÷£¬±ÈÈçºÜ¶àÔ¤¶¨ÒåµÄ$x³£Á¿
19. rubyÄÚ½¨ÕýÔò±í´ï£¬·½±ãÒ»µã


Ïà¹ØÎĵµ£º

ʹÓÃPython´¦ÀíExcel±í¸ñ

http://cocobear.info/blog/2009/01/16/use-python-deal-with-excel/
ʹÓÃPython´¦ÀíExcel±í¸ñ 2009Äê01ÔÂ16ÈÕ
¸ø°³µÄbossдµÄÒ»¸öС¹¤¾ß£¬Ê¹ÓÃPython¶ÔExcel½øÐÐͳ¼Æ£¬È»ºó°Ñ½áÊøÉú³ÉÒ»¸öеÄExcel±í¸ñ£¬Ê¹Óõ½ÁËxlrdºÍpyExceleratorÁ½¸ö¿â¡£
¼òµ¥µÄ½éÉÜÒ»ÏÂÕâÁ½¸ö¿â£¬ÏÈ˵xlrd£¬Õâ¸ö¿â¶ÁExcel±È½Ï·½±ã£¬¸÷ÖÖ·½·¨Ê¹ÓÃÆ ......

PythonÓëMicrosoft Office×Ô¶¯»¯²Ù×÷

http://www.cnblogs.com/Jedimaster/archive/2007/02/28/660209.html
¡¡¡¡ÅóÓѵļÒÈË×öÉúÒ⣬ÿÈÕ´Ó¸÷µØ·Öµê´¦ÊÕ¼¯±¨±í£¬È»ºó»ØÈ¥»ã×Ü¡£ÓÉÓÚ²»ÏëÓÃÄÇÖÖ¸´ÔӵĹÜÀíÈí¼þ£¬¾Í½ÐËûдһ¸öС¹¤¾ß¡£ÓÚÊÇËûÕÒµ½ÁËÎÒ£¬ÈÃÎÒÏëÏë°ì·¨¡£
¡¡¡¡PythonÊǸöÁîÈ˾ªÆæµÄ¹¤¾ß£¬¶ø²»½ö½öÊÇÒ»ÖÖÓïÑÔ¡£¶Ô±ÈÀÏÅƵÄPerl£¬¿´ËÆPython²»ÊÇÄÇôµÄ¾«Í¨ ......

python timeÄ£¿éÏê½â

 python µÄÄÚǶtimeÄ£°å·­Ò뼰˵Ã÷
 
Ò»¡¢¼ò½é
  timeÄ£¿éÌṩ¸÷ÖÖ²Ù×÷ʱ¼äµÄº¯Êý
  ˵Ã÷£ºÒ»°ãÓÐÁ½ÖÖ±íʾʱ¼äµÄ·½Ê½:
       µÚÒ»ÖÖÊÇʱ¼ä´ÁµÄ·½Ê½(Ïà¶ÔÓÚ1970.1.1 00:00:00ÒÔÃë¼ÆËãµÄÆ«ÒÆÁ¿),ʱ¼ä´ÁÊÇΩһµÄ
       µÚ¶þÖÖÒÔÊý× ......

½«PythonºÍAutoHotkey½áºÏÆðÀ´

http://www.autohotkey.com/forum/topic53773.html
Q:I am searching for is a way to execute AHK commands from a Python script. Is this possible?
A:Yes. Here is an example. 
tested with python2.6, requires AutoHotkey.dll in the working directory or path... 
ahkpython.py:
#Persistent
dllc ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ