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

PEP 0263 Defining Python Source Code Encodings

 
PEP 0263
Defining Python Source Code Encodings
Python will default to ASCII as standard encoding if no other
encoding hints are given.
To define a source code encoding, a magic comment must
be placed into the source files either as first or second
line in the file, such as:
# coding=<encoding name>
or (using formats recognized by popular editors)
#!/usr/bin/python
# -*- coding: <encoding name> -*-
or
#!/usr/bin/python
# vim: set fileencoding=<encoding name> :
More precisely, the first or second line must match the regular
expression "coding[:=]\s*([-\w.]+)". The first group of this
expression is then interpreted as encoding name.
To aid with platforms such as Windows, which add Unicode BOM
marks to the beginning of Unicode files, the UTF-8 signature
'\xef\xbb\xbf' will be interpreted as 'utf-8' encoding as well
(even if no magic encoding comment is given).
µ«ÊÇÔÚeclipse PydevÖÐÖ¸¶¨Ô´´úÂëÎļþΪutf-8¸ñʽ,eclipse²»»áÌí¼ÓBOM(»òÆäËûÔ­Òò),ËùÒÔ
ÒªÔÚµÚÒ»ÐлòÕßµÚ¶þÐÐÌí¼ÓÆ¥Åä"coding[:=]\s*([-\w.]+)"µÄ×Ö·û´®


Ïà¹ØÎĵµ£º

ɾ³ý¹¤³ÌÖÐsvnÎļþµÄ½Å±¾(Ruby°æºÍPython°æ)

Á½ÖÖ²»Í¬µÄÓïÑÔ,²»Í¬µÄ±í´ï!
Python½Å±¾ÊµÏÖ.
""
"
    File Name : clean.py
    File Date : 2009/11/5 14:22:56
    Author     : DannyLai
    Purpose     : Cle ......

Python×°ÊÎÆ÷

Ô­ÎÄ£ºhttp://www.klipdas.com/blog/?p=python-decorator
python×°ÊÎÆ÷½éÉÜ
Python 2.2ÖÐÒýÈëµÄ classmethod() ºÍ staticmethod() ÄÚÖú¯Êý£¬Äã¿ÉÒÔÕâÑùµ÷ÓÃclassmethod()£º
class A:
def foo(self, y):
print y
foo = classmethod(foo)
Ò²¿ÉÒÔÕâÑù£º
class A:
@classmethod
def foo(sel ......

Python IDE±È½ÏÓëÍƼö¡¾z¡¿

 ÎÒÏȸøÒ»¸ö³õ²½µÄ±í¸ñ°É£¬´ó¼ÒÈç¹ûÓÐʲôÒâ¼û£¬»òÓв¹³ä£¬»¶Ó­Ìá³ö¡£ÓÐЩÎÒûÓÐÓùý£¬ÏȲ»Ð´ÁË¡£
ÒÔÏÂÊÇÎÒʹÓùýµÄpython IDE:
     
³ýÁËPythonWin, VisualPythonÖ»Ö§³ÖWindows£¬ÆäËü¶¼ÖÁÉÙÖ§³ÖWin/Linux/Mac¡£
¸÷ÏÒ壺
×Ô¶¯²¹È«£º±äÁ¿/º¯ÊýÃû´òµ½Ò»°ëʱ£¬Ìáʾ¿ÉÄܵÄÍêÕûµÄ±äÁ¿/º¯ÊýÃû¡ ......

Python and MySQL

 ½üÀ´ÐèÒªÓÃPython¶ÔMySQLÊý¾Ý¿â½øÐвÙ×÷¡£Python¾ÃÎÅÆäÃû£¬Î´¼ûÆä“ÈË”£»Êý¾Ý¿âÔø¾­ºÜ¸ß·Ö£¬ÔçÒÑ»¹¸øÏÈÉú£¬¸üÎÞMySQL¾­Ñé¡£ÓÚÊÇÒ»ÇдÓÁ㿪ʼ£¬½è»úºÃºÃѧϰһ·¬¡£
PythonÕâ¸ö½Å±¾ÓïÑÔȷʵÃû¸±Æäʵ£¬ÓÃÁ˼¸Ìì±ãϲ»¶ÉÏËüÀ²¡£ºÜ¼ò½à£¬ºÜ·½±ã¡£ÒÔËõ¼õ×÷Ϊģ¿é·Ö¸î·û£¬¶ÁÆðÀ´ÉÍÐÄÔÃÄ¿¡£pythonµÄÄÚ½¨Êý¾ÝÀàÐÍ£¨ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ