ÉîÈëPythonÕªÒª
Ó¢ÎÄ°æDive in python¿ÉÒÔÔÚÏÂÃæÕÒµ½ÖÐÎÄ·Òëhttp://linuxtoy.org/docs/dip/toc/index.html
Ä£¿éµÄ__name__£¬µ±Ä£¿é±»importʱ£¬ÆäΪģ¿éµÄÃû×Ö£¬µ±Ä£¿é×÷ΪmainÖ´ÐеÄʱºò£¬ÆäΪ__main__
´ÊµäµÄkeyÊÇ´óСдÃô¸ÐµÄ¡£
ListÒ²Ö§³ÖÖØÔØ+²Ù×÷£¬ÓÃÓÚ½«Á½¸ölistÁ¬½ÓÆðÀ´£¬²¢·µ»ØÒ»¸öList£¬Òò´ËËüûÓÐextendedÖ´ÐиßЧ¡£listÒ²+=²Ù×÷¡£*¿ÉÒÔ×÷ÓÃÓÚlist£¬×÷ΪÖظ´Æ÷¡£
Tuple²»ÄÜÏòÆäÔö¼Ó£¬É¾³ýÔªËØ£¬ÒÔ¼°·µ»ØË÷ÒýÕâÑùµÄº¯Êý£¬µ«ÓÐin¡£¿ÉÒÔÈÏΪTuple±¾ÉíÊDz»¿É±äµÄ£¬Òò´Ë¿ÉÒÔ×÷ΪdictionaryµÄkey¡£
TupleºÍList¿ÉÒÔ»¥ÏàÏÔʽµÄ½øÐÐת»»£¬¶ÔÄÚÈݽøÐж³½á»ò½â¶³¡£
±äÁ¿¿ÉÒÔ²»ÓÃÉùÃ÷£¬µ«ËùʹÓõıäÁ¿±ØÐëÕâÇ°¾¹ý¶¨Òå¡£
Ïà¹ØÎĵµ£º
Íò¶ñµÄ±àÂë
С²Ë¶ÔÓÚÀÏʦÉÏÒ»½Ú½²µÄ²»ÊǺÜÃ÷°×£¬ÒòΪûÓÐÒ»±¾ÊéÊǽ«ÎļþÓëwebÒ»Æð½²Êڵģ¬Ëû¾ö¶¨×Ô¼ºÌ½¾¿Ò»ÏÂËüÃÇÖ®¼äµÄ²»Í¬£º
Ê×ÏÈ£¬Ð¡²ËÔÚCÅ̽¨ÁËÒ»¸öÎı¾Îĵµ file.txt,ÊäÈëËĸö×Ö£ºÎÒÊÇС²Ë¡£
È»ºó£¬Ð¡²ËÔÚshellÖÐÁ·Ï°ÆðÀ´£º
>>> file=open("c:\\file.txt","r")
>>> data=file.read()
>> ......
Install Python Eric IDE
1 Download following things
1) Python3.1
2) PyQt for python 3.1
(http://www.riverbankcomputing.co.uk/software/pyqt/download) I am using
PyQt-Py3.1-gpl-4.7.3-2.exe
3) Eric5 IDE
(http://eric-ide.python-projects.org/eric-download.html)
2 ......
python
ÓïÑÔ¸ÅÀÀ
python
½Å±¾¿ÉÒÔ´¦ÀíÍⲿ´«½øÀ´µÄ²ÎÊý ¼´sys.argv[]
£¬argv[]
µÄʹÓÃÓëlinux
ÏÂÏàͬ
python
±¾ÉíÊǽâÊÍÓïÑÔ£¬¿ÉÒÔ¶ÔÊäÈëµÄʽ×ÓÇóÖµ¡£python
Ö§³ÖµÄ¶ÔÏóÈçÕûÊý¶¼ÊÇÁ¢¼´Êý£¬´ËÍâËûÖ§³Ö¸´Êý£¬¼°¶ÔËÄÔòÔËËã½âÊÍ¡£
ptyhon
Ö§³Ö×Ö·û´®£¬·ÅÔÚµ¥/
Ë«ÒýºÅÄÚ£¬×Ö·û´®ÊÇÊý×飬¿ÉÒÔͨ¹ý[i: ......
½ñÌìÓöµ½ÁËÂé·³£º
ÓÃEclipse±àÒëpythonÏòsqliteÊý¾Ý¿â²åÈëÊý¾Ý×ÜÊÇÌáʾ±àÂëµÄÎÊÌ⣬ÎÒÉèÖÃÁËEclipseµÄworkspaceÓÃutf-8±àÂ뻹ÊDz»ÐÐ
µ«ÊÇÓÃEclipseдµÄ³ÌÐò±£´æÔÙÓÃIDLE´ò¿ªÈ´ÄܱàÒ룬Ææ¹ÖÁË
ÎÒ¿¼Âǵ½¿ÉÄÜÊÇÅäÖõÄÔÒò£¬ÕÒÕÒ±éÁËËùÓеÄÅäÖ㬶¼Ã»ÓÐÎÊÌ⣬°üÀ¨¹¤³ÌÎļþ
×îºóÎÒÓÃxvi32´ò¿ ......