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

pythonÖÐÀàÊôÐÔºÍÀàʵÀýµÄÊôÐÔµÄÇø±ð

ÒÔÏÂÄÚÈÝתÔØ×Ôjavaeye.comµÄ×÷Õßbluecrystal
»·¾³ËµÃ÷£ºÒÔÏÂpython´úÂë¾ùÔÚpython2.5ÏÂͨ¹ý¡£
    ×î½ü¿´µ½Ò»Ð©ÈËÔÚÌÖÂÛpythonÖÐÀàÊôÐÔºÍÀàµÄʵÀýµÄÊôÐÔ£¬ÎÒÒ²À´Ì¸Ì¸ÎÒ¸öÈ˶ÔÕâ¸öÎÊÌâµÄ¿´·¨£¬¹©pyer²Î¿¼¡£
    Ê×ÏÈÎÒÃÇÀ´¼òµ¥µÄ¶¨ÒåÒ»¸öpythonµÄÀࣺ
Python´úÂë
# coding: utf-8
  
  
class
 AAA():  
    aaa = 10
  
  
# ÇéÐÎ1 
  
obj1 = AAA()  
obj2 = AAA()   
print
 obj1.aaa, obj2.aaa, AAA.aaa   
      
# ÇéÐÎ2
  
obj1.aaa += 2
  
print
 obj1.aaa, obj2.aaa, AAA.aaa   
  
# ÇéÐÎ3
  
AAA.aaa += 3
  
print
 obj1.aaa, obj2.aaa, AAA.aaa  
# coding: utf-8
class AAA():
aaa = 10
# ÇéÐÎ1
obj1 = AAA()
obj2 = AAA()
print obj1.aaa, obj2.aaa, AAA.aaa

# ÇéÐÎ2
obj1.aaa += 2
print obj1.aaa, obj2.aaa, AAA.aaa
# ÇéÐÎ3
AAA.aaa += 3
print obj1.aaa, obj2.aaa, AAA.aaa
   
ÔÚÉÏÃæµÄ´úÂ룬ÀàAAA¶¨ÒåÁËÒ»¸öÊôÐÔaaa£¬pyµÄÀà³ÉÔ±±äÁ¿²»Ïñjava»òÕßc++ÄÇÑùÓзÃÎÊÏÞ¶¨·û£¬ÏñaaaÕâÑùµÄÊôÐÔ¶¨ÒåÓ¦¸ÃÀí½âΪÀàÊôÐÔ¶¨Ò壬
¼´¸Ã¶¨ÒåΪËùÓÐÀàAAAµÄʵÀýËù¹²Ïí£¬·ÃÎʸÃÊôÐÔ£¬¿Éͨ¹ýAAA.aaaµÄ·½Ê½À´·ÃÎÊ£¬ÊÇͨ¹ýÀàÃûÀ´ÒýÓ㬵«ÊÇÈç¹ûͨ¹ýÀàAAAµÄʵÀýÀ´ÒýÓÃaaaÊôÐÔ£¬
ÓÖ»áÊÇÔõÑùÄØ£¬ÎÒÃÇÀ´¿´ÇéÐÎ1.
    ¶ÔÓÚÇéÐÎ1£¬ÎÒÏàОø´ó¶àÊýÈ˶¼»áÕýÈ·µÄ˵³ö½á¹û£¬ÄǾÍÊÇ£º
        10  10  10
    ¶ÔÓÚÉÏÃæÕâ¸ö½á¹û£¬Ã»ÓÐÈκÎÐüÄͨ¹ýÁ½¸öAAAµÄʵÀý£¬ÒÔ¼°Í¨¹ýAAAÀàÃûÒýÓÃaaaÊôÐÔÖµ£¬¶¼ÊÇͬÑùµÄ´ð°¸¡£
    ÄÇÔÚÇéÐÎ2ÖУ¬Ó¦¸ÃÊÇʲô½á¹ûÄØ£¬ÎÒÏàÐÅ´ó¶àÊýÈË»¹ÊÇ»á˵³öÕýÈ·µÄ½á¹û£º
        12  10  10
    ÔÚÉÏÃæÕâ¸ö½á¹ûÖУ¬Ò»µ©Ö´ÐÐÁËobj1.aaa +=
2£¬Ò²¾ÍÒâζ×Åobj1Õâ¸öʵÀýÓÐÁ˸öʵÀ


Ïà¹ØÎĵµ£º

Python ×Ö·û´®·½·¨


 
Python-String-Function
×Ö·û´®ÖÐ×Ö·û´óСдµÄ±ä»»£º
    * S.lower()   #Сд
    * S.upper()   #´óд
    * S.swapcase()   #´óСд»¥»»
    * S.capitalize()   #Ê××Öĸ´óд
&n ......

python ÖÐÎÄÂÒÂë ÎÊÌâÉîÈë·ÖÎö

 
ת×Ô:http://hi.baidu.com/%C1%EE%BA%FC%CF%F3/blog/item/efb76fb7f0411dc437d3ca20.html
 
ÔÚ±¾ÎÄÖУ¬ÒÔ'¹þ'À´½âÊÍ×÷ʾÀý½âÊÍËùÓеÄÎÊÌ⣬“¹þ”µÄ¸÷ÖÖ±àÂëÈçÏ£º
  1. UNICODE (UTF8-16)£¬C854£»
  2£® UTF-8£¬E59388£»
  3£® GBK£¬B9FE¡£
Ò»¡¢pythonÖÐ ......

ÕýÔò±í´ïʽÓëpython

 ÔÚPythonÖÐÓÐÒ»¸ö·Ç³£ÖØÒªÒ²·Ç³£ºÃÓõÄÄ£¿ére£¬ÔÚimport reºó£¬¾ÍÄܹ»ÔÚPythonÖÐʹÓÃÕýÔò±í´ïʽ£¬Ô´ÓÚ´Ë´ÎÏîÄ¿ÒªÓÃÕýÔò±í´ïʽ¶Ôhtml´úÂëÌáÈ¡Ò»¶¨µÄ×Ö·û£¬ËùÒÔÔÚÕâÒ²¾ÍÓÃЩСÀý×ÓÀ´ÊìϤһÏÂÕýÔò±í´ïʽ
ÏÖÔÚ¾ÍÓÃ×î¼òµ¥µÄÀý×Ó
import re
s='<title>http://www.baidu.com</title>'
print re.findall(r'&l ......

python ÅжÏÊDz»ÊÇÖÐÎÄ×Ö

 ÏÂÃæÕâ¸öС¹¤¾ß°üº¬ÁË ÅжÏunicodeÊÇ·ñÊǺº×Ö£¬Êý×Ö£¬Ó¢ÎÄ£¬»òÕßÆäËû×Ö·û¡£ È«½Ç·ûºÅת°ë½Ç·ûºÅ¡£ unicode×Ö·û´®¹éÒ»»¯µÈ¹¤×÷¡£ »¹ÓÐÒ»¸öÄÜ´¦Àí¶àÒô×ֵĺº×ÖתƴÒôµÄ³ÌÐò£¬»¹ÔÚÕûÀíÖС£
 
#!/usr/bin/env python
# -*- coding:GBK -*-
"""ºº×Ö´¦ÀíµÄ¹¤¾ß:
ÅжÏunicodeÊÇ·ñÊǺº×Ö£¬Êý×Ö£¬Ó¢ ......

python os Ä£¿é

Python 3 ½Ì³Ì¶þ:Îļþ,Ŀ¼ºÍ·¾¶
http://www.cnitblog.com/yunshichen/archive/2009/04/01/55931.html
python osÄ£¿é
http://hi.baidu.com/happynp/blog/item/729243f902d5a751242df2c2.html
http://hi.baidu.com/fiber212121/blog/item/6e07ec03c97b6982d53f7c27.html
python getoptÄ£¿é
http://www.tsnc.edu.cn/de ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ