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

beginning python summary chapter 3 ʹÓÃ×Ö·û´®

0¡¢×Ö·û´®ÊDz»¿É±äµÄ¡£
1¡¢»ù±¾×Ö·û´®²Ù×÷£ºË÷Òý¡¢ÇÐÆ¬¡¢¸´ÖÆ¡¢³ÉÔ±¡¢³¤¶È¡¢×î´óºÍ×îС¡£
2¡¢×Ö·û´®¸ñʽ»¯£ºÓøñʽ»¯²Ù×÷·û°Ù·ÖºÅ%ʵÏÖ£¬eg:>>> format = "Hello, %s. %s enough for ya?"
                                                                          >>> values = ('world', 'Hot')  //Ôª×é
                                                                          >>> print format % values
      values ¿ÉÒÔÊǵ¥¶ÀµÄÖµ£¬±ÈÈç×Ö·û´®»òÊý×Ö£»Ò²¿ÉÒÔÊǶà¸öÖµ£¬±ÈÈçÔª×é¡£
      ÒªÔÚ¸ñʽ»¯×Ö·û´®ÀïÃæ°üÀ¨°Ù·ÖºÅ£¬ ÄãÓ¦¸ÃʹÓÃ%%¡£
      Èç¹ûÄã¸ñʽ»¯ÊµÊý£¨¸¡µãÊý£© µÄ»°£¬¿ÉÒÔʹÓÃfÕâ¸ö˵Ã÷ÀàÐÍ£¬¼ÓÉÏ×÷Ϊ¾«¶ÈµÄµãºÅ“.”£¬ºóÃæ¸úÉÏÄãÏ£Íû±£ÁôµØÐ¡ÊýλÊýµÄÊ®½øÖÆ¡£eg:>>> format = "Pi with three decimals: %.3f"
     >>> from math import pi
     >>> print format % pi
3¡¢Ä£°å×Ö·û´®£ºstringÄ£¿éÌṩÁíÍâÒ»ÖÖ¸ñʽ»¯ÖµµÄ·½·¨£ºÄ£°å×Ö·û´®¡£ËüµÄ¹¤×÷·½Ê½ÀàËÆÓںܶàUNIXShellÀïµÄ±äÁ¿Ìæ»»£¬Ê¹Óô«µÝµ½substitute·½·¨µÄfooµÄ¹Ø¼ü×Ö²ÎÊýÌæ»»$foo£º
>>> from string import Template
>>> s = Template('$x, glorious $x!')
>>> s.substitute(x='slurm')
'slurm, glorious slurm!'
Èç¹ûÌæ»


Ïà¹ØÎĵµ£º

PythonÔÚwindowsϵķ¾¶ÎÊÌâ

    windowsϵķ¾¶Ïñ“f:\program files\python\backup”ÆäÖГ\”ÐèÒªÓÃתÒå·û£¬Ð´³É“\\”£¬»òÕßÇ°Ãæ¼Órд³Épath
= r’f:\program files\python\backup’µ«ÊÇÔÚµ÷ÓÃһЩϵͳÃüÁÈços.system(rar a path e:\backup)»á³ö´í£¬Ô­ÒòÊÇ“program files&rdquo ......

cÓïÑÔÄ£Äâperl pythonÖеÄÊý×鸺ÊýË÷Òý

int main()
{
int a[] = {1,2,3,4,5};
int i;
int * p = a;
for (p = a + 4, i = 0; i < 5; i++) {
printf("%d ",p[-i]);
}

return 0;
}

......

Twisted ÍøÂ翪·¢python¿ò¼Ü

twistedÊÇÒ»¸öרÃÅÓÃÓÚpythonµÄÍøÂ翪·¢µÄ¿ò¼Ü¡£¿ÉÒÔ˵ÊÇÏÖÔÚpythonÖÐеÄÒ»Ö§ÖÁÁ¦ÓÚ·¢Õ¹¸ßÐÔÄÜÍøÂ翪·¢µÄ¿ò¼Ü£¬·¢Õ¹ºÜÎȶ¨¡£
http://twistedmatrix.com/trac/
http://www-128.ibm.com/developerworks/cn/linux/network/l-twist/part1/index.html
http://wiki.woodpecker.org.cn/moin/PyTwisted ......

¡¾zz¡¿Python³£ÓÃ×ÊÔ´ÍøÖ·

zz from ¡¶¿É°®µÄPython¡·
http://www.woodpecker.org.cn/
Python±ê×¼¿â http://www.woodpecker.org.cn:9081/doc/Python/_html/PythonStandardLib/
¼òÃ÷Python½Ì³Ì http://www.woodpecker.org.cn:9081/doc/abyteofpython_cn/chinese/index.html
Python¿ìËÙ½éÉÜ http://www.zoomquiet.org/share/s5/intropy/070322-intro ......

beginning python summary chapter 2 ÁбíºÍÔª×é

1¡¢ÔÚPythonÖÐ×î»ù±¾µÄÊý¾Ý½á¹¹ÊÇÐòÁУ¨sequence£©£¬ÐòÁÐÖеÄÿ¸öÔªËØ±»·ÖÅäÒ»¸öÊý×Ö——ÔªËØµÄλÖã¬Ò²½ÐË÷Òý¡£µÚÒ»¸öË÷ÒýÊÇ    0£¬µÚ¶þ¸öË÷ÒýÊÇ1£¬Èç´ËµÝÍÆ¡£ÐòÁÐÖеÄ×îºóÒ»¸öÌõÄ¿±»±ê¼ÇΪ-1£¬µ¹ÊýµÚ¶þÊÇ-2£¬Èç´ËµÝÍÆ¡£
2¡¢ÐòÁУºeg:edward = ['Edward Gumby', 42]£¬ÐòÁÐÒ²Äܰüº¬ÆäËûµÄÐòÁС£Ð ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ