Ò»¸öɾ³ýÎļþµÄPython³ÌÐò
PythonÊÇÒ»ÖÖÃæÏò¶ÔÏóµÄ½âÊÍÐԵļÆËã»ú³ÌÐòÉè¼ÆÓïÑÔ£¬Ò²ÊÇÒ»ÖÖ¹¦ÄÜÇ¿´ó¶øÍêÉƵÄͨÓÃÐÍÓïÑÔ£¬ÒѾ¾ßÓÐÊ®¶àÄêµÄ·¢Õ¹ÀúÊ·£¬³ÉÊìÇÒÎȶ¨¡£Python ¾ßÓнű¾ÓïÑÔÖÐ×î·á¸»ºÍÇ¿´óµÄÀà¿â£¬×ãÒÔÖ§³Ö¾ø´ó¶àÊýÈÕ³£Ó¦Óá£Ëü¾ßÓмòµ¥¡¢Ò×ѧ¡¢Ãâ·Ñ¡¢¿ªÔ´¡¢¿ÉÒÆÖ²ÐÔ¡¢½âÊÍÐÔ¡¢ÃæÏò¶ÔÏ󡢿ÉÀ©Õ¹ÐÔ¡¢¿ÉǶÈëÐÔÒÔ¼°·á¸»µÄ¿âµÈÌØÐÔ£¬Ä¿Ç°µÄÓ¦Ó÷¶Î§Ò²·Ç³£¹ã·º£¬Èçϵͳ±à³Ì¡¢Í¼Ïñ´¦Àí¡¢Êý¾Ý¿â±à³ÌµÈ·½Ãæ¡£
Python¿ª·¢Õß¿ÉÒÔʹÓÃÎı¾±à¼Æ÷£¨ÈçWindowsµÄ¼Çʱ¾µÈ£©»òÕßרҵµÄIDE£¨¼¯³É¿ª·¢»·¾³£©À´±àд³ÌÐò´úÂë¡£IDEʹµÃ¿ª·¢Õß¿ÉÒԺܷ½±ãµØ´´½¨¡¢ÔËÐС¢µ÷ÊÔPython³ÌÐò¡£IDE¿ÉÒÔÔÚPythonµÄ¹Ù·½ÍøÕ¾£¨http://www.python.org£©ÏÂÔØ£¬Ä¿Ç°£¨2009Äê9Ô£©×îа汾ΪPython 3.1.1£¬±¾ÎÄÖн«ÒÔPython 2.6.2Ϊ¿ª·¢Æ½Ì¨½øÐнéÉÜ¡£
¹ØÓÚPython³ÌÐòµÄÔËÐУ¬Æäʵһ¸öPython³ÌÐò¾ÍÏ൱ÓÚÒ»¸öÓ¦ÓóÌÐò£¬Ëü²»ÐèÒª¾¹ý±àÒ룬ֻÐèÒªÓû§µçÄÔÉÏÃæ°²×°Python»·¾³¼´¿É¡£ÒªÔËÐÐÒ»¸öpy³ÌÐò£¬Ö±½ÓË«»÷Õâ¸öpyÎļþ¼´¿É¡£Ò»°ãÇé¿öÏ£¬Ã»ÓÐÌáʾÓû§ÊäÈë»ò¿ØÖÆÆÁÄ»ÏÔʾ£¬´ò¿ªÒ»¸öpyÎļþʱ»áͻȻÉÁÒ»ÏÂÂíÉϾÍÍ˳ö£¬ÕâÊÇÓÉÓÚ³ÌÐòÔËÐÐÒѾÍê³ÉÁË¡£ÈôÐèÒªÏÔʾ£¬ÔòÒªÌí¼ÓÒ»¸öÆÁÄ»ÔÝÍ£µÄ´úÂ룺
os.system('pause')
ÔÚʹÓÃÕâ¸ö´úÂëÇ°£¬ÐèÒªÒýÓÃosÄ£¿é£ºimport os
ÏÂÃ濪ʼ½éÉÜɾ³ýÎļþµÄPython³ÌÐòÉè¼Æ£º
ºÜ¶àÈí¼þÔÚÔËÐÐʱ»á×Ô¶¯´´½¨Ò»Ð©±¸·ÝÎļþ£¬ÔÚ³ÌÐòÍ˳öºóÓÖ²»×Ô¶¯É¾³ý±¸·ÝÎļþ£¬Ëæ×ÅÎļþÊýÁ¿µÄÔö¼Ó£¬Ã¿¸ôÒ»¶Îʱ¼ä¾ÍÒªÇåÀíһϡ£Èç¹ûÎļþÊýÁ¿±È½Ï¶à£¬ÊÖ¹¤ÇåÀíÏÔÈ»±È½ÏÂé·³¡£ÓÚÊÇ¿ÉÒÔ±àдһ¸öPython½Å±¾À´Íê³É¸ÃÈÎÎñ¡£ÈçÏ´úÂ룺
# -*- coding: cp936 -*-
#file:E01.py
import os
#¸Ãº¯ÊýÓÃÓÚɾ³ýÎļþ
def scan(arg, dirname, names):
for file in names:
if file[0]=="~" or file[-4:]==".bak":
print "ɾ³ýÎļþ£º", file
file=dirname+"\\"+file
os.remove(file)
print "Íê³É!"
#ÌáʾÓû§ÊäÈëĿ¼·¾¶
path=raw_input("ÇëÊäÈëҪɾ³ýÎļþËùÔÚĿ¼£º(ÈçD:\
Ïà¹ØÎĵµ£º
You are here: Home ‣ Dive Into Python 3 ‣
Difficulty level: ♦♢♢♢♢
Installing Python °²×°Python
❝ Tempora mutantur nos et mutamur in illis. (Times change, and we change with them.) ❞
— ancient Roman proverb
D ......
#!/Library/Frameworks/Python.framework/Versions/2.5/bin/python
# encoding: utf-8
import sys, time
import thread
SLEEP_TIME = 0.0001
def run_benchmark(n, m):
# print(">> Python 2.5.1, stackless 3.1b3 here (N=%d, M=%d)!\n" % (n, m))
lock ......
µ±Äê×ö±ÏÒµÂÛÎĵÄʱºòopenCV¾ÍÏñÊÇÎÒµÄÈðÊ¿¾üµ¶£¬Ì«ÓиÐÇéÁË¡£Èç½ñÓÃÁËÒ»Äê¶àµÄpython£¬·¢ÏÖopenCVÒ²ÓÐpython°æ±¾ÁË£¬ÕæÊÇÌ«¿áÁË£¡µ±È»pythonÔÚ´¦ÀíͼÏñʱ»¹¿ÉÒÔÓÃÆäËü¿âÀýÈçPIL(Python Imaging Library )£¬Ò»ÖÖÇáÁ¿¼¶µÄͼÏñ¿â¡£Ä¿Ç°openCV1.0°æ±¾¶ÔÓ¦µÄpython°æ±¾Îª2.5£¬openCV2.0¶ÔÓ¦python 2.6¡£
¸½Â¼£º
1. һƪ½éÉÜͼ ......
²Ù×÷ϵͳ£ºlinux debian 4.0£¬ python°æ±¾2.5
s1:°²×°python2.5-dev¡£ÒòΪPython.hÊÇÔÚdev°üÖвÅÓС£
test@debian:~/test_python_c$ aptitude search python2.5-dev
p python2.5-dev - Header files and a static library for Python.
test@debian:~/test_python_c$ sudo aptitude install python2 ......
À´Ô´£º ×÷Õߣºzhaoweikid ·¢²¼Ê±¼ä£º2007-07-04 ÔĶÁ´ÎÊý£º
pythonµÄpoplibÄ£¿éÊÇÓÃÀ´´Ópop3ÊÕÈ¡ÓʼþµÄ£¬Ò²¿ÉÒÔ˵ËüÊÇ´¦ÀíÓʼþµÄµÚÒ»²½¡£
POP3ÐÒé²¢²»¸´ÔÓ£¬ËüÒ²ÊDzÉÓõÄÒ»ÎÊÒ»´ðʽµÄ·½Ê½£¬ÄãÏò·þÎñÆ÷·¢ËÍÒ»¸öÃüÁ·þÎñÆ÷±ØÈ»»á»Ø¸´Ò»¸öÐÅÏ¢¡£pop3ÃüÁîÂëÈçÏ£º
¡¡ÃüÁ ......