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£ºÏÂÔØ
Ïà¹ØÎĵµ£º
²»¶à˵ÁË£¬Ö±½Ó¿´´úÂë°É£¡
import os
path = 'e:/Download/'
kzm = []
kzmTemp = set()
kzmTemp2 = []
dict = {}
for root,dirs,files in os.walk(path):
for file in files:
ext = os.path.splitext(file)[1][1:]
  ......
±ê׼ͷ²¿
#!/usr/bin/python
±àÂë
ËùÓÐµÄ Python ½Å±¾Îļþ¶¼Ó¦ÔÚÎļþÍ·±êÉÏ #-*- coding:utf8 -*- ¡£ÉèÖÃ±à¼Æ÷£¬Ä¬Èϱ£´æÎª utf8 ¸ñʽ¡£
mainº¯Êý
Ó¦ÓóÌÐòÒª¶¨Òåmainº¯Êý¶ø²»ÒªÖ±½Óд½Å±¾
def main():
dosomething()
if
__name__ == "__main__"
:
main()
Èç¹ûÊÇÈ«¾Ö±äÁ¿£¬ÔòÐèÒªÏÔʽ¼ÓÉ ......
1 Ó°ÏñÓëͼÐÎ×ÊÁϵĴ¦Àí
ÌÖÂÛͼÐÎ(Ó°Ïñ) ±¾ÉíµÄ´¦Àí£¬¶øÌÖÂÛµÄÄÚÈݽ«»á¼¯ÖÐÔÚPython Imaging Library (PIL) ÕâÒ»Ì׳Ìʽ¿âÉÏ¡£
PIL ÊÇPython ÏÂ×îÓÐÃûµÄÓ°Ïñ´¦ÀíÌ×¼þ£¬ÓÉÐí¶à²»Í¬µÄÄ£×éËù×é³É£¬²¢ÇÒÌṩÁËÐí¶àµÄ´¦Àí¹¦ÄÜ£¬ÔÊÐíÎÒÃÇÔÚ¼òµ¥µÄPython ³ÌʽÀï½øÐÐÓ°ÏñµÄ´¦Àí¡£ ʹÓÃÏñPIL ÐíÑùµÄ³Ìʽ¿âÌ ......
PythonÖÐRangeºÍXRangeµÄÇø±ð(Difference between Range and XRange in Python)
×î½ü»úÆ÷³öÁ˵ãÎÊÌ⣬ËùÒÔһֱûÓÐдÐµĶ«Î÷³öÀ´¡£Ö®Ç°ÔÚ¶ÁPythonµÄ´úÂëµÄʱºò£¬·¢¾õºÃ¶àÈËϲ»¶ÓÃXRange£¬¶ø²»ÊÇRange£¬ÎÒÒ²Ö»ÊǼǵÃѧϰµÄʱºò¿ªÊ¼Ñ§µ½µÄÊÇRange£¬ºóÃæÓÖ¿´µ½ÓиöXRange£¬µ±Ê±Ò²Ã»ÓÐÉ£¬ÎªÊ²Ã´PythonÀïÃæÒªÓÐÁ½¸öͬÑùµÄ¹¦ ......