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

PythonÈëÃŵÄ36¸öÀý×Ó——05 ´ÏÃ÷µÄ±äÁ¿

# 005
# ÔÚPythonÖиø±äÁ¿¸³ÖµÊ±²»ÐèÒªÉùÃ÷Êý¾ÝÀàÐÍ
i = 33
print i
# ¿ÉÒÔÕâÑù×öµÄÔ­ÒòÊÇPython°Ñ³ÌÐòÖÐÓöµ½µÄÈκζ«Î÷¶¼¿´³ÉÊǶÔÏó(Á¬intÒ²²»ÀýÍâ)
# ÕâÑù,ÔÚʹÓöÔÏóʱ,±àÒëÆ÷»á¸ù¾ÝÉÏÏÂÎĵĻ·¾³À´µ÷ÓöÔÏó×ÔÉíµÄ·½·¨Íê³ÉÒþʽµÄת»»
# ÄãÉõÖÁ¿ÉÒ԰ѳÌÐòд³ÉÕâÑù
print 3 * 'haha '
# µ«Èôд³ÉÕâÑù±àÒëÆ÷¾Í»á±¨´í(×¢Òâ3ºóÃæµÄµã)
# print 3. * 'haha'

output:
1
2
33
haha haha haha


Ïà¹ØÎĵµ£º

pythonÀàÐÍת»»£¬ÊýÖµ²Ù×÷(ת)


http://hi.baidu.com/guzhilei1986/blog/item/8969b4debe99e150ccbf1ae7.html
º¯Êý                       ÃèÊö  
int(x [,base ])          ......

python ¶à¼Ì³Ð(2)

from:  http://www.chinesepython.org/pythonfoundry/tut2.3/tmp/multiple.html
9.5.1 ¶à¼Ì³Ð Multiple Inheritance
Python supports a limited form of multiple inheritance as well. A class definition with multiple base classes looks as follows:
PythonͬÑùÓÐÏÞµÄÖ§³Ö¶à¼Ì³ÐÐÎʽ¡£¶à¼Ì³ÐµÄÀඨÒåÐÎÈçÏÂÀ ......

Python Re

1. Basic
²Î¿¼¡¶PythonÕýÔò±í´ïʽ²Ù×÷Ö¸ÄÏ¡· 
Ä£¿ére£¬perl·ç¸ñµÄÕýÔò±í´ïʽ
regex²¢²»Äܽâ¾öËùÓеÄÎÊÌ⣬ÓÐʱºò»¹ÊÇÐèÒª´úÂë
regex»ùÓÚÈ·¶¨ÐԺͷÇÈ·¶¨ÐÔÓÐÏÞ×Ô¶¯»ú
2. ×Ö·ûÆ¥Åä(Ñ­Ðò½¥½ø)
Ôª×Ö·û
. ^ $ * + ? { [ ] \ | ( )
1) "[" ºÍ "]"³£ÓÃÀ´Ö¸¶¨Ò»¸ö×Ö·ûÀà±ð£¬Ëùν×Ö·ûÀà±ð¾ÍÊÇÄãÏëÆ¥ÅäµÄÒ»¸ö×Ö·û¼¯¡£Èç[ ......

ʵս¹¹½¨PythonºÍC++»ìºÏϵͳ

      ¹ØÓÚC++ºÍPythonÖ®¼ä»¥Ïàµ÷ÓõÄÎÊÌ⣬¿ÉÒÔ²éÕÒµ½ºÜ¶à×ÊÁÏ¡£±¾ÎĽ«Ö÷Òª´Ó½â¾öʵ¼ÊÎÊÌâµÄ½Ç¶È¿´ÈçºÎ¹¹½¨Ò»¸öPythonºÍC++»ìºÏϵͳ¡£
                       &nbs ......

£¨×ª£©Python×Ö·û´®µÄencodeÓëdecode isinstance

Ê×ÏÈÒª¸ãÇå³þ£¬×Ö·û´®ÔÚPythonÄÚ²¿µÄ±íʾÊÇunicode±àÂ룬Òò´Ë£¬ÔÚ×ö±àÂëת»»Ê±£¬Í¨³£ÐèÒªÒÔunicode×÷ΪÖмä±àÂ룬¼´ÏȽ«ÆäËû±àÂëµÄ×Ö·û´®½âÂ루decode£©³Éunicode£¬ÔÙ´Óunicode±àÂ루encode£©³ÉÁíÒ»ÖÖ±àÂë¡£
decodeµÄ×÷ÓÃÊǽ«ÆäËû±àÂëµÄ×Ö·û´®×ª»»³Éunicode±àÂ룬Èçstr1.decode('gb2312')£¬±íʾ½«gb2312±àÂëµÄ×Ö·û´®×ª»»³ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ