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, ......
writeblog.csdn.net writeblog.csdn.net/PostEdit.aspx
Õâ¸ö³ÌÐòºÜÔçÒÔǰ¾Íд¹ýÁË£¬¶øÇÒÊDzο¼µÄ±ðÈ˵Äд£¬¾ßÌå˵ķ¢ÔÚÄÄÀïÎÒ¶¼Íü¼ÇÁË¡£ÕâÀï¾ÍËãÊǰëÔ´´ÁË£¬ÈçÓÐÇÖȨÇ뼰ʱ֪ͨ¸ÄÕý¡£
ÒòΪ´Ó½ñÌì1ÔÂ1ºÅ¿ªÊ¼£¬GoogleÉ϶©ÔĵÄÌìÆøÔ¤±¨·þÎñÒѾȡÏûÁË£¬¹À¼ÆÊÇGoogle±»Ê©¼ÓѹÁ¦ÁË¡£·´ÕýÊÇÊÕ²»µ½ÌìÆøÔ¤±¨ÁË¡£ÕýºÃÖØÊ°ÒÔǰ ......
1 ±éÀúÎļþ¼ÐºÍÎļþ
import os
import os.path
# os,os.pathÀï°üº¬´ó¶àÊýÎļþ·ÃÎʵĺ¯Êý,ËùÒÔÒªÏÈÒýÈëËüÃÇ.
# Çë°´ÕÕÄãµÄʵ¼ÊÇé¿öÐÞ¸ÄÕâ¸ö·¾¶
rootdir = " d:/download "
for parent, dirnames, filenames in os.walk(rootdir):
  ......
1.install ruby
download from http://www.ruby-lang.org/en/news/2009/12/07/ruby-1-9-1-p376-is-released/
2.install rails
ruby gem install rails --include-dependencies
3.install mysql
download from http://sourceforge.net
ruby gem install&nb ......
ÄÜÕûÀí´ó²¿·ÖÎÞÓÃÎļþ
#!/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)
......