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

Python×Ö·û´®²Ù×÷

 #Python×Ö·û´®²Ù×÷
''
'1.¸´ÖÆ×Ö·û´®'
''
#strcpy(
sStr1,
sStr2)
sStr1 =
'strcpy'
sStr2 =
sStr1
sStr1 =
'strcpy2'
print
sStr2
''
'2.Á¬½Ó×Ö·û´®'
''
#strcat(
sStr1,
sStr2)
sStr1 =
'strcat'
sStr2 =
'append'
sStr1 +
=
sStr2
print
sStr1
''
'3.²éÕÒ×Ö·û'
''
#strchr(
sStr1,
sStr2)
sStr1 =
'strchr'
sStr2 =
'r'
nPos =
sStr1.
index(
sStr2)
print
nPos
''
'4.±È½Ï×Ö·û´®'
''
#strcmp(
sStr1,
sStr2)
sStr1 =
'strchr'
sStr2 =
'strch'
print
cmp(
sStr1,
sStr2)
''
'5.ɨÃè×Ö·û´®ÊÇ·ñ°üº¬Ö¸¶¨µÄ×Ö·û'
''
#strspn(
sStr1,
sStr2)
sStr1 =
'12345678'
sStr2 =
'456'
#sStr1 and
chars both in
sStr1 and
sStr2
print
len(
sStr1 and
sStr2)
''
'6.×Ö·û´®³¤¶È'
''
#strlen(
sStr1)
sStr1 =
'strlen'
print
len(
sStr1)
''
'7.½«×Ö·û´®ÖеÄСд×Ö·ûת»»Îª´óд×Ö·û'
''
#strlwr(
sStr1)
sStr1 =
'JCstrlwr'
sStr1 =
sStr1.
upper(
)
print
sStr1
''
'8.×·¼ÓÖ¸¶¨³¤¶ÈµÄ×Ö·û´®'
''
#strncat(
sStr1,
sStr2,
n)
sStr1 =
'12345'
sStr2 =
'abcdef'
n =
3
sStr1 +
=
sStr2[
0:
n]
print
sStr1
''
'9.×Ö·û´®Ö¸¶¨³¤¶È±È½Ï'
''
#strncmp(
sStr1,
sStr2,
n)
sStr1 =
'12345'
sStr2 =
'123bc'
n =
3
print
cmp(
sStr1[
0:
n]
,
sStr2[
0:
n]
)
''
'10.¸´ÖÆÖ¸¶¨³¤¶ÈµÄ×Ö·û'
''
#strncpy(
sStr1,
sStr2,
n)
sStr1 =
''
sStr2 =
'12345'
n =
3
sStr1 =
sStr2[
0:
n]
print
sStr1
''
'11.×Ö·û´®±È½Ï£¬²»Çø·Ö´óСд'
''
#stricmp(
sStr1,
sStr2)
sStr1 =
'abcefg'
sStr2 =
'ABCEFG'
print
cmp(
sStr1.
upper(
)
,
sStr2.
upper(
)
)
''
'12.½«×Ö·û´®Ç°n¸ö×Ö·ûÌæ»»ÎªÖ¸¶¨µÄ×Ö·û'
''
#strnset(
sStr1,
ch,
n)
sStr1 =
'12345'
ch =
'r'
n =
3
sStr1 =
n *
ch +
sStr1[
3:
]
print
sStr1
''
'13.ɨÃè×Ö·û´®'
''
#strpbrk(
sStr1,
sStr2)
sStr1 =
'cekjgdklab'
sStr2 =
'gka'
nPos =
-
1
for
c in
sStr1:
    if
c in
sStr2:
        nPos =
sStr1.
index(
c)
    


Ïà¹ØÎĵµ£º

opencv python cool

µ±Äê×ö±ÏÒµÂÛÎĵÄʱºòopenCV¾ÍÏñÊÇÎÒµÄÈðÊ¿¾üµ¶£¬Ì«ÓиÐÇéÁË¡£Èç½ñÓÃÁËÒ»Äê¶àµÄpython£¬·¢ÏÖopenCVÒ²ÓÐpython°æ±¾ÁË£¬ÕæÊÇÌ«¿áÁË£¡µ±È»pythonÔÚ´¦ÀíͼÏñʱ»¹¿ÉÒÔÓÃÆäËü¿âÀýÈçPIL(Python Imaging Library )£¬Ò»ÖÖÇáÁ¿¼¶µÄͼÏñ¿â¡£Ä¿Ç°openCV1.0°æ±¾¶ÔÓ¦µÄpython°æ±¾Îª2.5£¬openCV2.0¶ÔÓ¦python 2.6¡£
¸½Â¼£º
1. һƪ½éÉÜͼ ......

Eclipse+PyDev = Python±à¼­Æ÷£¬

http://www.ibm.com/developerworks/cn/opensource/os-cn-ecl-pydev/Á¬½ÓÕâ¸öÍøÖ·£¬²»»áÈÃÄãʧÍûµÄ¡£
PyDev ¼ò½é
2003Äê7ÔÂ16ÈÕ£¬ÒÔ Fabio Zadrozny ΪÊ×µÄÈýÈË¿ª·¢Ð¡×éÔÚÈ«Çò×î´óµÄ¿ª·ÅÔ´´úÂëÈí¼þ¿ª·¢Æ½Ì¨ºÍ²Ö¿â SourceForge ÉÏ×¢²áÁËÒ»¿îеÄÏîÄ¿£¬¸ÃÏîĿʵÏÖÁËÒ»¸ö¹¦ÄÜÇ¿´óµÄ Eclipse²å¼þ£¬Óû§¿ÉÒÔÍêÈ«ÀûÓà Eclipse À ......

Python ×Ö·û´®·½·¨


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

[ת]ʹÓÃpythonµ÷ÓüÆËãËù·Ö´Ê

·¢ÐÅÈË: TRAD (GFans), ÐÅÇø: NLP
±ê  Ìâ: Ô­´´£ºÊ¹ÓÃpythonµ÷ÓüÆËãËù·Ö´Ê
·¢ÐÅÕ¾: ˮľÉçÇø (Mon Nov 23 13:30:46 2009), Õ¾ÄÚ
´úÂëºÜ¼òµ¥£¬µ«ÎÒ×Ô¼ºÃþË÷ÁËÒ»ÏÂÎç,·¢³öÀ´¹²ÏíÒ»ÏÂ
°ÑÕâ¸öÎļþͬICTALAS30.DLL £¬DATAÎļþ¼Ð£¬Configure.xm l·ÅÔÚͬһ¸öĿ¼Ï¼´¿É¡£
python´úÂë
#coding:gb2312 
from cty ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ