PythonÔÚwindowsϵķ¾¶ÎÊÌâ
windowsϵķ¾¶Ïñ“f:\program files\python\backup”ÆäÖГ\”ÐèÒªÓÃתÒå·û£¬Ð´³É“\\”£¬»òÕßÇ°Ãæ¼Órд³Épath
= r’f:\program files\python\backup’µ«ÊÇÔÚµ÷ÓÃһЩϵͳÃüÁÈços.system(rar a path e:\backup)»á³ö´í£¬ÔÒòÊÇ“program files”ÖмäÓÐÒ»¸ö¿Õ¸ñ£¬¿Õ¸ñÐèÒªÓÃË«ÒýºÅÀ¨ÆðÀ´£¬¾Í±ä³ÉÁËpath = r’f:\”program
files\python\backup”’¡£
ÕâÑùºÃÏñûÓдíÁË£¬µ«ÊÇÈç¹ûÓÃos.mkdir(path)»á³ö´í£¬ÔÒòÊÇpathÀïÃæÓÐË«ÒýºÅ……Õâ¸ö¾ÍÈÃÈ˺ÜÎÞÓïÁË¡£ÎҵĽâ¾ö·½°¸ÊǶ¨ÒåÁ½¸öpath£ºpath1ºÍpath2¡£ÕâÑùrar
a path1 e:\backupºÍ os.mkdir(path2)¶¼²»»á³ö´íÁË¡£Èç¹û´òӡ·¾¶µÄ»°£¬ÓÃprint path1
Ïà¹ØÎĵµ£º
import random def windex(lst):
'''an attempt to make a random.choose() function that makes weighted choices
accepts a list of tuples with the item and probability as a pair'''
wtotal = sum([x[1] for x in lst])
......
http://code.google.com/p/shedskin/ Shed Skin 0.3 - support for 3 new standard library modules (now about 20 in total): - itertools (jeremie roquet) - heapq (jeremie roquet) - csv (converted using shedskin) - 4 new example programs (now 44 in total!): - maximum weighted matching al ......
֮ǰдÁËÒ»¸ö×Ô¶¯½âѹѹËõÎļþµ½Ñ¹ËõÎļþËùÔÚÎļþ¼ÐµÄ½Å±¾
ºó¸ù¾Ý×Ô¼ºÐèÒª£¬Ð´ÁËÁíÍâÁ½¸ö¡£ÔÀíÒ»Ñù
¶¼ÊÇʹÓÃwinrarµÄÃüÁî
µÚÒ»¸ö½Å±¾Ã»¿¼ÂÇÖܵ½£¬Ö»ÄܽâѹrarÎļþ
¸Ä½øºó¿ÉÒÔÖ§³ÖwinrarÖ§³ÖµÄ¸÷ÖÖÎļþ
°ÑÖ¸¶¨Îļþ¼ÐϵÄÎļþ±£´æµ½Ö¸¶¨Îļþ¼Ð
#rardir.py
import os
import sys
src=sys.argv[1]
dst=sys.argv[2]
......
ת×Ô http://www.javaeye.com/topic/66558
³õѧPython,Óöµ½ºÜ¶à±àÂëÎÊÌ⣬¼ÇÏÂÀ´ÒÔÃ⽫À´ÓÖÍüÁË£¬ºÜ¶à¶«Î÷²»¶®£¬¶¼ÊÇÊôÓÚ²»ÇóÉõ½â£¬ÂÒϽáÂÛ£¬µ«Ïëµ½ÄóöÀ´¿ÉÒÔÓÐÈÈÐÄͬѧָ³ö´íÎóËùÔÚ£¬±ãºñÆðÁ³Æ¤ÁË……
Ê×ÏÈÐèÒªÁ˽âPythonÖÐÓÐÁ½ÖÖ×Ö·û´®(ÑϸñµØ˵,Ëƺõ²»ÄÜÕâô½Ð)¡£Ò»ÖÖÊÇÆÕͨµÄstr¶ÔÏó£¨Ã¿¸ö×Ö·ûÓÃ8bits± ......
תÔØ×Ô£ºhttp://hi.baidu.com/myitlyj/blog/item/25586bd7088ba3dba044df6b.html
ÔÚ³ÌÐòÖÐʹÓÃÅäÖÃÎļþÀ´Áé»îµÄÅäÖÃһЩ²ÎÊýÊÇÒ»¼þºÜ³£¼ûµÄÊÂÇ飬ÅäÖÃÎļþµÄ½âÎö²¢²»¸´ÔÓ£¬ÔÚpythonÀï¸üÊÇÈç´Ë£¬ÔÚ¹Ù·½·¢²¼µÄ¿âÖоͰüº¬ÓÐ×öÕâ¼þÊÂÇéµÄ¿â£¬ÄǾÍÊÇConfigParser£¬ÕâÀï¼òµ¥µÄ×öһЩ½éÉÜ¡£
ConfigParser½âÎöµÄÅäÖÃÎļþµÄ¸ñÊ ......