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

ѧϰ¡¶PythonÓïÑÔÈëÃÅ¡·µÚËÄÕ º¯Êý


ÔõôÕÒ²»µ½µÚÈýÕµÄѧϰ±Ê¼ÇÁË£¿¶ªÁË£¿
PythonµÄº¯ÊýûÓÐʲôµÄ£¬¿ÉÒÔ˵£¬¿´ÁË¡¶¼òÃ÷Python½Ì³Ì¡·ºó£¬¾Í»áдÁË¡£
ÕâÒ»ÕÂÌṩµÄÄÚÈÝÒ²±È¡¶¼òÃ÷Python½Ì³Ì¡·Òª¶àһЩ¡£±È½Ï¸´ÔÓµÄÊÇ×÷ÓÃÓò¹æÔò£¬²»ÖªµÀÊÇÊéû½²Çå³þ»¹ÊÇ·­ÒëµÃ²»ºÃ£¬±È½ÏÄѶ®¡£Ç®Äܵġ¶C++³ÌÐò½Ì³Ì¡·¹ØÓÚº¯ÊýµÄ×÷ÓÃÓò¹æÔò½²µÃÒªÇå³þЩ£¬ÓÐC++µÄ֪ʶÔÚÀïÃæ£¬Àí½âPythonµÄº¯Êý×÷ÓÃÓò¹æÔò£¬ºÃ¶®ºÜ¶à¡£ËƺõÁ½ÕßҲûÓÐÊ²Ã´Çø±ð¡£
º¯Êý²ÎÊý·½ÃæÓÐЩ²»Ò»Ñù£¬C++µÄÖµ´«µÝ¡¢Ö¸Õë´«µÝ¡¢ÒýÓô«µÝ·ÖµÃºÜÇå³þ¡£¶øPythonµÄ²ÎÊý´«µÝÓÐЩ²»Äܸıä²ÎÊýµÄÖµ£¬ÓÐЩÊÇ¿ÉÒԵġ£ÐèҪСÐĵĶԸ¶¡£»¹Óйؼü×ֵIJÎÊý¡¢¿É±ä²ÎÊý£¬¶¼ÊÇC++ûÓеÄÄÚÈÝ¡£PythonµÄº¯Êý¿ÉÒÔ²»ÓÃreturn£¬µ«ÊǺóÃæµÄÉè¼Æ¸ÅÄÊǽ¨ÒéÒªÓÃreturn·µ»Ø¡£
lambda¡¢map¡¢applyÕâЩ¹¤¾ßºÜ·½±ã£¬Óнű¾µÄÓ°×ÓÔÚÀïÃæ¡£
×îÈÃÎÒ¾ªÆæµÄÊÇ“º¯ÊýÊǶÔÏó: ·ÇÖ±½Óµ÷ÓÔÕâһС½Ú¡£PythonÖк¯ÊýµÄÁé»îÊÇC++Ëù²»¿É±ÈµÄ¡£PythonµÄº¯Êý¾ÍÏñһСÍÅÕ³ÍÁÒ»Ñù£¬¿ÉÒÔÈà¹ýÀ´´ê¹ýÈ¥µÄʹÓá£
“º¯Êý³£¼ûµÄÎÊÌâ”ȷʵÈÃÎÒÕâ¸öÐÂÊÖÃÔºýÁË£¬ÔÝʱÏȲ»ÌáËüÃǰɡ£¶øÇÒÕâÒ»½ÚÀïÃæµÄÀý×ÓËÆºõÓÐÎÊÌ⣬ÓÐһЩÊéÉÏ˵²»ÄÜÔËÐУ¬µ«ÔÚÎÒµÄPythonÖÐÈ´ÄÜÔËÐУ»ÁíÓÐһЩ˵ÄÜÔËÐУ¬µ«ÎÒÔËÐгö´í¡£ÊDz»ÊÇPythonµÄ°æ±¾¸üµü¸Ä±äÁËһЩ¶«Î÷£¿ÕâÒ»½ÚµÄÄÚÈÝ»¹ÊÊÓÃÂð£¿


Ïà¹ØÎĵµ£º

PythonÈëÃŵÄ36¸öÀý×Ó Ö® 34

Ô´´úÂëÏÂÔØ£ºÏÂÔØµØÖ·ÔÚÕâÀï
raiseÓÐÁ½¸ö²ÎÊý£¬µÚÒ»¸öÊÇÓÉÎÒÃÇ×Ô¼º¶¨ÒåµÄÒì³£ÀàÐÍ£¬µÚ¶þ¸öÊǹØÓÚ´ËÒì³£µÄÉÙÁ¿ËµÃ÷ÐÅÏ¢¡£
# 038
def getAge():
age = input('Input your age:')
if (age < 0 or age > 160):
raise 'BadAgeError', 'It is impossible!!!!!'
# end of if
return age
# ......

£¨×ª£©UnicodeºÍPythonµÄÖÐÎÄ´¦Àí

      ——ÓÉÓÚ×î½üÔÚ×öÓйØÍøÒ³ËÑË÷µÄÏîÄ¿£¬Éæ¼°µ½Ò»Ð©±àÂë·½ÃæµÄ֪ʶ£¬Ð¡µÜÔÚÍøÉÏżȻµØ·¢ÏÖÁËÕâôһƪÎÄÕ£¬ºÜÒ×¶®£¬²»»Þɬ£¬ÎªÁË·½±ã×Ô¼ºÒ²Í¬Ê±ÄÜ·½±ã´ó¼Ò£¬¾ÍתÁ˹ýÀ´£¬ÒÔ×÷²Î¿¼……
      ÎÄÕ³ö´¦£ºhttp://blog.csdn.net/tingsking18/arc ......

PythonºÍPHPÖ®±È½Ï

  ż¶û×ö¸ö¼òµ¥µÄWEB·þÎñ²âÊÔ³ÌÐò£¬ÎÒ»¹ÊÇϲ»¶²ÉÓÃPHP¡£¼ò½à£¬·ç¸ñºÍC/C++½Ó½ü£¬ÉÏÊֿ죬¶øÇÒ¿âÒ²ºÜÆëÈ«¡£ÒÔǰΪ¹ã¶«Òƶ¯×öÒÆ¶¯ÐÐÒµÖն˵ÄÑÝʾ³ÌÐòʱ£¬²ÉÓùúÄÚÒ»¸öÐÖµÜдµÄFleaPHP¿ªÔ´¿ò¼Ü£¬Á½Öܲ»µ½µÄʱ¼ä£¬ÎÒ´ÓÒ»¸ö¶ÔPHPÒ»ÎÞËùÖªµÄˮƽ£¬¿ìËٵĸ㶨ÁË30¶à¸öÒ³ÃæµÄºǫ́£¬ºóÀ´ÑÝʾЧ¹ûÒ²²»´í£¬Ò²ºÜÎȶ¨£¬´Ó´Ë¶ÔPHPÓÐÁ ......

Python ¶þ½øÖÆÎļþ¶ÁÈ¡ÏÔʾ

filename=raw_input('enter file name:')
f=open(filename,'rb')
f.seek(0,0)
index=0
for i in range(0,16):
print "%3s" % hex(i) ,
print
for i in range(0,16):
print "%-3s" % "#" ,
print
while True:
temp=f.read(1)
if len(temp) == 0:
break
else:
print "%3s" % temp.encode('hex'),
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ