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

python°²×°Ö®°²×°Ä£¿éÖÆ×÷

pythonµÄeggÎļþÓеãÏñjavaÖеÄjarÎļþ£¬ÊÇÒ»¸ö¹¤³Ì´ò°üÎļþ£¬±ãÓÚ°²×°²¿Ê𣬽ö´ËÒ»µã£¬¸ø¶àÉÙpythoner´øÀ´Á˶àÉÙ¼¤¶¯¡£
ÈçºÎÖÆ×÷eggÎļþÄØ£¿see¹Ù·½Îĵµhttp://peak.telecommunity.com/DevCenter/PythonEggs£¬
µ½http://pypi.python.org/pypi/setuptoolsÏÂÔØsetuptools°ü£¬È»ºó°²×°£º
python setup.py
1.ÖÆ×÷eggÎļþ
ÏÂÃæ¿ªÊ¼eggÎļþµÄÖÆ×÷£º£¨¼ûÉÏÒ»¸öeggµÄÌû×Ó£¬±È½ÏÏêϸ£©
ÔÚÒª´ò°üµÄÎļþ¼Ð¸¸Ä¿Â¼ÖÐн¨setup.py
#setup.py
view plaincopy to clipboardprint?
#coding=utf8  
 
from setuptools import setup, find_packages  
 
setup(  
    name = "eggtest",  
    version = "0.1",  
    packages = find_packages(),  
 
    description = "egg test demo",  
    long_description = "egg test demo",  
    author = "lidehong",  
    author_email = "idehong@gmail.com",  
 
    license = "GPL",  
    keywords = ("test", "egg"),  
    platforms = "Independant",  
    url = "http://blog.csdn.net/hong201/",   
      

#coding=utf8
from setuptools import setup, find_packages
setup(
    name = "eggtest",
    version = "0.1",
    packages = find_packages(),
    description = "egg test demo",
    long_description = "egg test demo",
    author = "lidehong",
    author_email = "idehong@gmail.com",
    license = "GPL",
    keywords = ("test", "egg"),
    platforms = "Independant",
    url = "http://blog.csdn.net/hong201/",
 
)
 
name£º°üÃû
version£º°æ±¾
packages £º´ò°üµÄÎļþ
description£ºÃèÊöÐÅÏ¢
author£º×÷Õß
url£ºÏÂÔØ


Ïà¹ØÎĵµ£º

Python Áбí(list)²Ù×÷

´´½¨Áбí
sample_list = ['a',1,('a','b')]
Python Áбí²Ù×÷
sample_list = ['a','b',0,1,3]
µÃµ½ÁбíÖеÄijһ¸öÖµ
value_start = sample_list[0]
end_value =
sample_list[-1]
ɾ³ýÁбíµÄµÚÒ»¸öÖµ
del sample_list[0]
ÔÚÁбíÖвåÈëÒ»¸öÖµ
sample_list[0:0] = ['sample value']
µÃµ½ÁбíµÄ³¤¶È
list_length = ......

ÒÔPython Imaging Library ½øÐÐÓ°Ïñ×ÊÁÏ´¦ÀíPIL


1   Ó°ÏñÓëͼÐÎ×ÊÁϵĴ¦Àí
ÌÖÂÛͼÐÎ(Ó°Ïñ) ±¾ÉíµÄ´¦Àí£¬¶øÌÖÂÛµÄÄÚÈݽ«»á¼¯ÖÐÔÚPython Imaging Library (PIL) ÕâÒ»Ì׳Ìʽ¿âÉÏ¡£
PIL ÊÇPython ÏÂ×îÓÐÃûµÄÓ°Ïñ´¦ÀíÌ×¼þ£¬ÓÉÐí¶à²»Í¬µÄÄ£×éËù×é³É£¬²¢ÇÒÌṩÁËÐí¶àµÄ´¦Àí¹¦ÄÜ£¬ÔÊÐíÎÒÃÇÔÚ¼òµ¥µÄPython ³ÌʽÀï½øÐÐÓ°ÏñµÄ´¦Àí¡£ Ê¹ÓÃÏñPIL ÐíÑùµÄ³Ìʽ¿âÌ ......

PythonºÍSingleton £¨µ¥¼þ£©Ä£Ê½

ÎÒÖªµÀµÄÒ»ÖÖÔÚ
python
ÖÐ
Singleton mode
µÄʵÏÖÈçÏ£º
class Foo: pass
def
instance():
   
global inst
   
try:
       
inst
   
except:
       
inst =
Foo
()
&n ......

Python ´¦Àí×Ö½Ú


zz from: http://blog.sina.com.cn/s/blog_4b5039210100f1tu.html
Ô­ÎÄÓеãС´íÎ󣬸ÄÁËÒ»µãµã¡£
ÎÒÃÇÖªµÀpythonÖ»¶¨ÒåÁË6ÖÖÊý¾ÝÀàÐÍ£¬×Ö·û´®£¬ÕûÊý£¬¸¡µãÊý£¬ÁÐ±í£¬Ôª×飬×ֵ䡣µ«ÊÇCÓïÑÔÖÐÓÐЩ×Ö½ÚÐ͵ıäÁ¿£¬ÔÚpythonÖиÃÈçºÎʵÏÖÄØ£¿ÕâµãÆÄÎªÖØÒª£¬ÌرðÊÇÒªÔÚÍøÂçÉϽøÐÐÊý¾Ý´«ÊäµÄ»°¡£

pythonÌṩÁËÒ»¸östruc ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ