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

Python ×Ö·û´®·½·¨


 
Python-String-Function
×Ö·û´®ÖÐ×Ö·û´óСдµÄ±ä»»£º
    * S.lower()   #Сд
    * S.upper()   #´óд
    * S.swapcase()   #´óСд»¥»»
    * S.capitalize()   #Ê××Öĸ´óд
    * String.capwords(S)
      #ÕâÊÇÄ£¿éÖеķ½·¨¡£Ëü°ÑSÓÃsplit()º¯Êý·Ö¿ª£¬È»ºóÓÃcapitalize()°ÑÊ××Öĸ±ä³É´óд£¬×îºóÓÃjoin()ºÏ²¢µ½Ò»Æð
    * S.title()    #Ö»ÓÐÊ××Öĸ´óд£¬ÆäÓàΪСд£¬Ä£¿éÖÐûÓÐÕâ¸ö·½·¨
×Ö·û´®ÔÚÊä³öʱµÄ¶ÔÆ룺
    * S.ljust(width,[fillchar])
      #Êä³öwidth¸ö×Ö·û£¬S×ó¶ÔÆ룬²»×㲿·ÖÓÃfillcharÌî³ä£¬Ä¬ÈϵÄΪ¿Õ¸ñ¡£
    * S.rjust(width,[fillchar])    #ÓÒ¶ÔÆë
    * S.center(width, [fillchar])    #Öмä¶ÔÆë
    * S.zfill(width)   #°ÑS±ä³Éwidth³¤£¬²¢ÔÚÓÒ¶ÔÆ룬²»×㲿·ÖÓÃ0²¹×ã
×Ö·û´®ÖеÄËÑË÷ºÍÌæ»»£º
    * S.find(substr, [start, [end]])
      #·µ»ØSÖгöÏÖsubstrµÄµÚÒ»¸ö×ÖĸµÄ±êºÅ£¬Èç¹ûSÖÐûÓÐsubstrÔò·µ»Ø-1¡£startºÍend×÷ÓþÍÏ൱ÓÚÔÚS[start:end]ÖÐËÑË÷
    * S.index(substr, [start, [end]])
      #Óëfind()Ïàͬ£¬Ö»ÊÇÔÚSÖÐûÓÐsubstrʱ£¬»á·µ»ØÒ»¸öÔËÐÐʱ´íÎó
    * S.rfind(substr, [start, [end]])
      #·µ»ØSÖÐ×îºó³öÏÖµÄsubstrµÄµÚÒ»¸ö×ÖĸµÄ±êºÅ£¬Èç¹ûSÖÐûÓÐsubstrÔò·µ»Ø-1£¬Ò²¾ÍÊÇ˵´ÓÓÒ±ßËãÆðµÄµÚÒ»´Î³öÏÖµÄsubstrµÄÊ××Öĸ±êºÅ
    * S.rindex(substr, [start, [end]])
    * S.count(substr, [start, [end]])    #¼ÆËãsubstrÔÚSÖгöÏֵĴÎÊý
    * S.replace(oldstr, newstr, [count])  
      #°ÑSÖеÄoldstarÌ滻Ϊnewstr£¬countΪÌæ»»´ÎÊý¡£ÕâÊÇÌæ»»µÄͨÓÃÐÎʽ£¬»¹ÓÐһЩº¯Êý½øÐÐÌØÊâ×Ö·ûµÄÌæ»»
    * S.strip([char


Ïà¹ØÎĵµ£º

µÚÒ»´ÎдÍêÕûµÄPython GUI³ÌÐò

 Ò¹ÀïÓÃÍâ¹ÒÈÝÒ×±»²é£¬Òò´ËÏëÈòËÊìµÄʱ¼ä¼¯Öе½°×Ì죬ÿ´Î¶¼Òª¿ÚË㣬Âé·³£¬ÕýºÃ¸Õ¸ÕѧÁËwxPython£¬Ò»Ê±ÊÖÑ÷£¬À´×Ô¼ºÐ´¸ö°É¡£Ëä˵´¿Êô×ÔÓé×ÔÀÖ£¬µ«Ò²Ñ§µ½²»ÉÙ¶«Î÷¡£ÏÖ¼ÇÓÚÏ¡£
1. ¹ØÓÚPythonµÄGUIÉè¼Æ
Ò»Ö±ÒÔÀ´¶¼Ã»ÓÐÒ»¸ö×ã¹»ºÃµÄKiller IDE£¬ÕâÒ²¹Ö²»µÃ£¬Ã»ÓÐÒ»¸ö×㹻ǿ´óµÄºǫ́£¬ÒªÏë×ö³ÉÖØÁ¿¼¶µÄIDE̸ºÎÈÝÒ×£¨ÒªÊ ......

ÔÚPythonÖж¯Ì¬°ó¶¨property

 ÔÚPythonÖпÉÒÔ°Ñproperty¶¯Ì¬µÄ°ó¶¨µÄobjectµÄ¼Ì³ÐÀàÖУ¬²¢ÇÒ¿ÉÒÔ¶¨Òå´øÓвÎÊýµÄgetºÍset·½·¨¡£
±ÈÈ磬ÎÒÃǶ¨ÒåÁËÈ«¾Ö±äÁ¿g£¬È»ºóͨ¹ýÁ½¸ö·½·¨À´´æÈ¡gµÄÄÚÈÝ
def get_g(self):
    return g
def set_g(self, _g):
    global g
    g = _g
¶¨ÒåÒ»¸öobjectµÄ¼Ì³ ......

[¶À¼Ò]Google½«ÏÞÖÆPythonÓïÑÔµÄÓ¦Óà ¿ª·¢ÉçÇøÈÈÒé

2009-11-16 
Collin WinterÊÇPythonÉçÇøһλÆľßÓ°ÏìÁ¦µÄ¿ª·¢Õߣ¬ËûÔøÊÇCPythonÏîÄ¿µÄºËÐÄ¿ª·¢ÕßÖ®Ò»¡¢Ò²ÔøÊÇUnladen Swallow£¨¼ûÎÄĩעÊÍ£©µÄºËÐÄ¿ª·¢Õߣ¬²ÎÓëÁ˺ܶàPythonÏîÄ¿µÄ¿ª·¢¡£½üÀ´´«ÎÅGoogle½«ÔÚÆäÐÂÏîÄ¿ÖÐÏÞÖÆPythonµÄʹÓã¬Îª´ËÓпª·¢Õߣ¨ÒÔK±íʾ£©ÔÚGoogle ÂÛ̳Öй«¿ªÑ¯ÎÊÁËCollin Winter£¬Collin Winte ......

python ¶íÂÞ˹·½¿é

Õâ¸öËãÊÇC++ǶÈëpython°É£¬ÀûÓÃpythonʵÏÖÏÔʾºÍʼþ´¦Àí£¬C++ʵÏÖÂß¼­
ÒÔºóÓÐʱ¼äÒ²»á·´¹ýÀ´ÊÔÊÔ£º£© 
import pygame
import sys
import os
import ctypes
def cur_file_dir():
#»ñÈ¡½Å±¾Â·¾¶
path = sys.path[0]
#ÅжÏΪ½Å±¾Îļþ»¹ÊÇpy2exe±àÒëºóµÄÎļþ£¬Èç¹ûÊǽű¾Îļþ£¬Ôò·µ»ØµÄÊǽű¾µÄÄ¿Â ......

ÉîÈë GalCon£ºPython¡¢ÓÎÏ·¿ª·¢ºÍÈ˹¤ÖÇÄÜ

Alex. J. Champandard
ÀµÓºƣ¨http://laiyonghao.com£© Òë
Ô­ÎĵØÖ·£ºhttp://aigamedev.com/open/interviews/inside-galcon-python-ai/
AiGameDev.comÔÚÕâ¸öÖÜÒ»µÄ pratical insights ÊǶÔPhil Hassey²É·Ã¡£Phil ÊÇÒ»¸ö¶ÀÁ¢ÓÎÏ·¿ª·¢Õߣ¬Ò²ÊÇÓÎÏ·²úÒµÉçÇøµÄ»îÔ¾·Ö×Ó¡£ËûÔøÓ®µÃ2006Äê4Ô嵀 Ludum Dare ±ÈÈü£¨Õâ¸ö±ÈÈü¹Ø×¢ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ