Python Project
* PYTHON Ç÷ÏòÓÚ½«¹¦ÄÜÏà½üµÄ¶ÔÏó·Å½øÒ»¸öMODULE£¨Îļþ£©À²»Óõ£ÐĶÔÏó»áÌ«´ó£¬ÒòΪÈç¹û¶ÔÏóÌ«´óÁË£¬ÄÇËü¿ÉÄÜÊÇ×öµÄÊÂÐÔÌ«¶àÁË
ÐèÒª±»Öع¹¡¢·Ö½â¡£
* ¿ª·¢¸¨Öú¹¤¾ßÊÇPYTHONµÄÒ»¸öÇ¿Ïî¡£Èç¹¹½¨¹¤¾ß¡¢Í³¼Æ¹¤¾ßµÈµÈ£¬Ö»ÒªÓÐÐèÇó£¬ËüÒ»¶¨°ìµÃµ½£¬ÒòΪÕâЩӦÓö԰²È«ºÍÐÔÄÜÒªÇ󲻸ߣ¬·´
¶ø¶Ô¿ª·¢µÄ¼ò½àÐÔÓÐºÜ¸ßµÄÆòÇó¡£
* Ö»°Ñ»á·¢ÉúÒâÍâµÄÄÇһС²¿·Ö·Å½øtryÀ°Ñtry³É¹¦ºóµÄ²Ù×÷·Å½øelseÀtryʧ°ÜºóµÄ²Ù×÷·Å½øexceptÀ°Ñ²»¹Ü³É¹¦»òʧ°Ü¶¼ÐèÒªµÄ²Ù×÷
·Å½øfinallyÀΪʲô²»Ð´ÔÚtry-catch¿éºóÄØ£¿ÒòΪÕâ¸ötry-catch¿é´ú±íÒ»¸ö·çÏÕ²Ù×÷¼¯ºÏµÄÓïÒ⣩
* PYTHONÖпÉÒÔ¼ò»¯²Ù×÷µÄÄÚÖÃÓï·¨ÓУºfor/else(Èç¹ûfor¼¯ºÏΪ¿ÕÔòÖ´ÐÐelseÓï¾ä£©
Python ÊÇGoogleµÄ3¸ö¹Ù·½ÓïÑÔÖ®Ò»£¬ÔÚGoogleµÄÓ¦Óÿª·¢ÖдóÁ¿Ó¦Ó㬲»¹ý£¬¸ü¶àµÄÊÇÓ¦ÓÃÔÚ¿ª·¢¸¨Öú¹¤¾ßÉÏ£º
£ª The Google build system.All of Google's corporate code is checked into a repository and the dependency and building of this code is managed by python.Greg mentioned that to create code.google.com took about 100 lines of python code. But since it has so many dependencies,the build system generated a 3 megabyte
£ª Packaging. Google has an internal packaging format like RPM. These packages are created using python.
£ª Binary Data Pusher. This is the area where Alex Martelli is working, on optimizing pushing bits between thousands of servers
£ª Production servers. All monitoring, restarting and data collection functionality is done with python
£ª Reporting. Logs are analyzed and reports are generated using Python.
£ª A few services including code.google.com and google groups. Most other front ends are in C++ (google.com) and Java (gmail). All web services are built on top of a highly optimizing http server wrapped with SWIG.
##########################################################
Python doesn't force you into Java's nasty one-c
Ïà¹ØÎĵµ£º
Îļþ²Ù×÷ÊdzÌÐòÉè¼ÆÖв»¿É»òȱµÄÖØÒª²¿·Ö¡£Pythonͨ¹ýÒ»¸öÄÚÖú¯ÊýopenÀ´´ò¿ªÎļþ¡£
open(filename,mode,buffer)
ÆäÖеÚÒ»¸ö²ÎÊýÊÇÒª´ò¿ªµÄÎļþµÄÎļþÃû£¬±ØÑ¡£»µÚ¶þ¸öÊÇ´ò¿ª·½Ê½£¬¿ÉÑ¡£»µÚÈý¸öΪ»º³åÇø£¬¿ÉÑ¡¡£Ä¬ÈÏÇé¿öÏÂÊÇÒÔ“¶Á”ģʽ´ò¿ªÎļþ¡£¸Ãº¯Êý ......
½ñÌìͻȻÓÐÒ»¸öÏë·¨£¬¾ÍÊÇÏë×Ô¼ºÐ´Ò»¸ö·Òë½Å±¾¡£¿ÉϧGoogleÌṩµÄAPIÊǹ©ÍøÂçÓ¦Óõġ£¸ÕºÃÔÚ¡¶dive into python¡·ÀïÃæÕâ±¾ÊéÀïÃæ¿´µ½ÈçºÎ´ÓHTMLÎĵµÖÐÌáÈ¡³öÀ´×Ô¼ºÏëÒªµÄÄÚÈÝ£¬ÄÇÕâÑùµÄ»°£¬¿É²»¿ÉÒÔÄ£Äâä¯ÀÀÆ÷À´·¢ËÍÏë·ÒëµÄ¾ä×Ó£¬È»ºóÔÙ½ÓÊÕ·µ»Ø½á¹ûºóµÄHTMLÔ´Â룬×îºó´ÓÖÐÌáÈ¡³ö·ÒëµÄ½á¹ûÄØ£¿¡¡¡¡ÆäʵÊÇÐеģ¬ÒòΪÀûÓ ......
ΪÁË´Ó×Ö·û´®ÖÐÌáȡʱ¼ä£¬²¢½øÐбȽϣ¬Òò´ËÓÐÁËÕâ¸öÎÊÌ⣬ÈçºÎ½«×Ö·û´®×ª»»³ÉdatetimeÀàÐÍ
1.×Ö·û´®ÓëtimeÀàÐ͵Äת»»
>>> import time
>>> timestr = "time2009-12-14"
>>> t = time.strptime(timest ......
ÒÔÏÂÊÇÒ»¸öͨ¹ýminidomÄ£¿éдÎļþµÄÍêÕûʾÀý£¬ÊÇÔÚ×î½ü×öµÄÏîÄ¿WalleÉÏÃæÓõ½µÄ,Õâ¸öʾÀýµÄÄ¿µÄÊÇÉú³ÉÒ»¸öÈçϵĸñʽµÄxml£¬Îļþ¸ñʽΪÎÞBOM utf-8¡£
Éú³ÉxmlÎļþ¸ñʽ£º
<?xml version="1.0" encoding="utf-8"?>
<coverages>
<coverage>
  ......
Ò»¡¢¼ò½é
py2exeÊÇÒ»¸ö½«python½Å±¾×ª»»³ÉwindowsÉϵĿɶÀÁ¢Ö´ÐеĿÉÖ´ÐгÌÐò(*.exe)µÄ¹¤¾ß£¬ÕâÑù£¬Äã¾Í¿ÉÒÔ²»ÓÃ×°python¶øÔÚwindowsϵͳÉÏÔËÐÐÕâ¸ö¿ÉÖ´ÐгÌÐò¡£
py2exeÒѾ±»ÓÃÓÚ´´½¨wxPython,Tkinter,Pmw,PyGTK,pygame,win32com clientºÍserver,ºÍÆäËüµÄ¶ÀÁ¢³ÌÐò¡£py2exeÊÇ·¢²¼ÔÚ¿ªÔ´Ðí¿É֤ϵġ£
¶þ¡¢°²×°py2exe
......