PythonºÍRubyµÄ¶Ô±È£¬¾ÀÕýһЩÎó½â
PythonºÍRubyµÄ¶Ô±È£¬¾ÀÕýһЩÎó½â
ÏÂÃæÊÇÎÒÔÚ¿´Á½Æª¹ØÓÚPythonºÍRuby¶Ô±ÈµÄÎÄÕÂʱ£¬Ëù×÷µÄ¾ÀÕý£¬ÔÎĶ¼Êǹ㷺Á÷Ðеģ¬±È½ÏºÃÕÒ¡£
------------------------------------------------------
¡¶rubyºÍpythonµÄ±È½Ï¡·¸üÕýÒ»µãÊÂÇé
1¡¢Îĵµ¡¢¿ªÔ´ÏîÄ¿¡¢¿âÖ§³Ö£¬ÕâЩ¶«Î÷Ruby²»Òª¸úPython±È£¬²»ÊǼ¸¸öÊýÁ¿¼¶µÄÎÊÌ⣬ºÎ±ØòËƲ¢ÁеÄÅÅÔÚÒ»Æð¡£
2¡¢PythonȷʵûÓаÑÕýÔò±í´ïʽģ¿éÄÚÖõ½ºËÐÄÀïÃ棬µ«ÊÇÈ´ÓÐreÕâ¸ö±ê×¼¿âµÄÖ§³Ö£¬µ±Ê±µÄÄ¿µÄÒ²ÊÇΪÁ˾¡¿ÉÄܵİѺËÐÄ×öµ½×îС¡£ÎÒ²»Ì«Ã÷°×£¬Ê¹Óñê×¼¿âºÍÄÚÖÃÓÐʲôÇø±ð£¬ÉõÖÁ¿ÉÒÔ×÷ΪÓŵ㣿ÇÒʹÓÃPythonÖеÄÕýÔò±í´ïʽҲ²»¹ýÊǶà¸öimport reºÍµ÷ÓÃʱµÄ¼¸¸ö×Öĸ¶øÒÑ£¬Ê¡ÏµÄÎÞÊý¸öend×ãÒÔµÖÏúÕâ¸öÎÊÌâÁË¡£
3¡¢ÖÁÓÚǶÈëHTML¹¦ÄÜ£¬PythonÀïÓÐC/Python˫ʵÏÖµÄCheetahÄ£°å¿ÉÓ㬾Ý˵ÍÐZopeµÄ¸££¬ÃÀ¹úº£¾üºÍ·¨¹úÕþ¸®ÔÚÓ㬲»ÖªRubyÕâ¸ö¹¦ÄܵijÉÊì¶ÈÈçºÎ£¿
4¡¢mod_rubyÄ£¿éµÄ³öÏÖʱ¼äºÜ¶Ì£¬Èç¹û×÷ÕßûÓÐÌý¹ýmod_pythonÄǾÍʵÔڹª¹ÑÎÅÁË¡£ÎÒÔÚÒ»ÄêÇ°·Òëmod_python3.2.8ÎĵµµÄʱºò£¬mod_pythonÒѾºÜ³ÉÊìÁË£¬ÒÔÖÁÓÚ¼¸ºõËùÓеÄPython WEB¿ò¼Ü¶¼Ö§³Ö¹¹½¨ÔÚÆäÉÏÀ´Ìá¸ßЧÂÊ¡£µ«ÊÇ£¬Ëƺõmod_rubyµÄ¸üУ¬Ã¿ÄêÒ²Ö»Óм¸´Î¡£mod_python¸üÓÐgnu.orgÕâÑùµÄÖØÁ¿¼¶Ó¦Ó㬲»Öªmod_rubyÓÐûÓУ¿
5¡¢ÁíÍ⣬Ìáµ½unix¹¤¾ß¡£Red hat LinuxµÄ°²×°³ÌÐòÒ»Ö±ÊÇÓÃPythonдµÄ£¬Èç¹ûÄãÇ¡ÇÉÓÃubuntu£¬ÄÇô£¬ÄǸöÌáʾÄã¸üÐÂϵͳµÄ³ÌÐò£¬Ò²ÊÇÓÃPythonдµÄ¡£
6¡¢raccºÍdoctools£¬ÇëÔÁÂÎҵĹª¹ÑÎÅ£¬ÎÒgoogleÁËһϾÓÈ»³ýÁËÄãµÄÕâƪÎÄÕ»¹Ã»ÕÒµ½¼¸Æª¹ØÓÚraccµÄÖÐÎÄÄÚÈÝ£¬Õ·×ªÖ®ºó²Å²éµ½ÊÇÒ»ÖÖÀàËÆyaccµÄ¹¤¾ß¡£´ÓgoogleµÄ½Ç¶È½²£¬raccµÄ¿ÉÓÃÐÔÎҾͲ»¶à˵ÁË¡£ÎÒ²»Ì«Ã÷°×Ò»¸öyacc¹¤¾ßÔÚÈÕ³£±à³Ìµ±ÖÐÓжà´óµÄʵÓÃÐÔ£¬µ«ÊǼÈÈ»×÷ÕßÌáµ½ÁËÎÒ¾Í˳±ãÕÒÁ˸öÎÒÖ»Ìý˵¹ýÃû×Ö£¬¸ù±¾Ã»ÓùýµÄspark¡£googleµÄ½á¹ûÊÇ"racc ruby":"python spark"=159,000:659,000¡£ÖÁÓÚdoctools£¬ÎÒ¸üÊÇÎÞ»°¿É˵£¬ÔÚgoogleÉÏÖ»ÓÐ15,800Ìõ¼Ç¼£¬ÎÒµ½ÏÖÔÚ¶¼¿´²»³öÕâ¸ö¶«Î÷ÊǸÉʲôÓõġ£ËùÒÔÕÒÁ˸ö¹À¼ÆÊÇÀàËƵĶ«Î÷¶Ô±ÈÁËһϣ¬docutils£¬googleµÄ¼Ç¼ÊÇ25,400Ìõ¡£
7¡¢“±ÈPython¿â¸üÍêÕûµÄÃæÏò¶ÔÏóÓï·¨”¡£ÊÔÎÊÃæÏò¶ÔÏóµÄÄ¿µÄÊÇʲô£¿ÔÙÕߣ¬rubyÄÜ·ñÏñPythonÒ»Ñù£¬¾ø´ó¶àÊý±ê×¼¿â¸ù±¾²»ÐèÒª²éÎĵµ£¬Ö»Òª²Â²âһϴóÌåÉϵÄÃû×Ö£¬È»ºódir()һϣ¬ÔÙhelp()һϾͿÉÒÔÖ±½ÓÉÏÊÖ£¬Óõ½µÚ¶þ´ÎµÄʱºò£¬ÒòΪģ¿éÄÚ¶«Î÷ʵÔÚÌ«ÉÙ£¬¼ÇÒäÌ«·½±ã£¬¾Í¿ÉÒÔÖ±½
Ïà¹ØÎĵµ£º
1.³£Ó÷½·¨£¬²»´ø²ÎÊý
def decator(func):
def inner_func(*args):
args = (i * 2 for i in args)
return func(*args)
return inner_func
@decator
def add(a, ......
¹ØÓÚC++0x
Ô¤¼ÆÓÚÃ÷Äêµ×ÍƳöµÄбê×¼C++0x£¬Ëä˵ÒѽӽüÊչٽ׶Σ¬È´ÈÔÓÐÈô¸ÉÓдý½ÓÄɵÄÐÂÌá°¸±»Ìá³ö¡£ÓÈÆäÖµµÃ¹Ø×¢µÄÊÇ£¬Óëlambda±í´ïʽÒÔ¼°¾Ö²¿º¯ÊýÏà¹ØµÄÌá°¸“Unified Function Syntax£¨Í³Ò»µÄº¯ÊýÓï·¨£©”£¬¾¡¹Ü²»Êܱê׼ίԱ»á´ý¼û£¨Á½Äê¼äÀú¾ËÄ´ÎÑÓ³Ù±í¾ö£¬Á½´Î²»Óèͨ¹ý£©£¬ÈÔÈ»“ÍçÇ¿µØ”ÍƳöÁ ......
PythonÒѾÊÇ3.1°æ±¾ÁË,Óëʱ¾ã½ø¸üн̳Ì.
±¾ÎÄÊʺÏÓÐJava±à³Ì¾ÑéµÄ³ÌÐòÔ±¿ìËÙÊìϤPython
±¾ÎijÌÐòÔÚwindows xp+python3.1a1 ²âÊÔͨ¹ý.
±¾ÎÄÌáµ½µÄidleÖ¸python shell,¼´°²×°pythonºóÄãÔڲ˵¥¿´µ½µÄIDLE(python gui)
ÔÚidleÀïctrl+n¿ÉÒÔ´ò¿ªÒ»¸öд°¿Ú,ÊäÈëÔ´Âëºóctrl+s¿ÉÒÔ±£´æ,f5ÔËÐгÌÐò.
·²´ò¿ªÐ´°¿Ú¼´Ö¸ctrl ......
ÄÜÕûÀí´ó²¿·ÖÎÞÓÃÎļþ
#!/usr/bin/python
#syscleaner.py
import os
import os.path
#delete files and directory recursively
def itedel(dir):
print('in dir :'+dir)
for doc in os.listdir(dir):
try:
if(os.path.isdir(doc)):
itedel(dir+'\\'+doc)
......