python Îļþ±¸·Ý´íÎó
#! c:\python26
# Filename: backup_ver1.py
import os
import time
source=[r'C:\test', r'C:\test1']
target_dir='D:\\back\\'
target=target_dir+time.strftime('%Y%m%d%H%M%S')+'.zip'
zip_command="rar a -r \"%s\" \"%s\"" %(target,''.join(source))
if os.system(zip_command)==0:
print'successful backup to',target
else:
print'backup failed'
ÔÚdosÏÂÔËÐУ¬Ìáʾ¡°²»ÄܶÁÈ¡c:\testc:\test1µÄÄÚÈÝ¡± £¬Èç¹û¸ÄΪ¡°source=r'C:\test'¡± £¬Ö»±¸·ÝÒ»¸öĿ¼£¬¿ÉÒÔÔËÐС£
²»ÖªµÀÔõô½â¾ö
''.join(source)
==>
' '.join(source)
¼Ç×ÅÁ½¸öµ¥ÒýºÅÖмäÊǸö¿Õ¸ñ¡£
Èç¹ûÊǿոñ£¬ÔÚdosÔËÐÐÌáʾ¡°ÕÒ²»µ½Ö¸¶¨Â·¾¶¡±£¬²»ÄܿոñµÄ
Âß¼ÓеãÎÊÌ⣬Õâ¸öÓ¦¸ÃÄܹ¤×÷£º
zip_command="rar a -r \"%s\" \"%s\"" % (target, "\" \"".join(source))
ºÇºÇ,ºÍÎÒÒ»ÑùÒ²ÔÚѧÕâ½ÚÄØ
{{
Ïà¹ØÎÊ´ð£º
Ïñ C µÄ scanf() ÄÇÑù
±ÈÈç¶ÁÈë 1 2 3 a b c
ÿ´Î¶ÁÈëÒ»¸ö
ÏÂÃæÕâ¸öÓ¦¸ÃÊÇÄãÏëÒªµÄ°É£º
Python code:
>>> k = raw_input()
0 0123 ds dsl sd
>>> k
'0 0123 ds dsl sd'
>>> ......
ÎÒÿ´ÎÉÏ´«µÄÎļþ¶Áµ½µÄÊý¾Ý¶¼²»ÕýÈ·¡£2M µÄͼƬ¶ÁµÃ10¶àK ¡£¡£ÄÄλ´óÏÀ¿ÉÒÔ°ï°ïÎÒ°¡¡£
#!D:\ProgrammerTools\python26\python.exe
#encoding=utf-8
import cgitb
import os
cgitb.enable()
import cgi,urllib ......
pythonµÄPIL¿â×Ô´øµÄ·½·¨Ö»ÄܽøÐоØÐεÄÇиÈç¹ûÎÒÓÐÁËÒ»¸ö¶à±ßÐθ÷¸ö¶¥µãµÄ×ø±ê£¬ÈçºÎ¶ÔÏÖÓеÄͼƬ°´ÕÕÕâ¸ö¶à±ßÐνøÐÐÇиîÄØ£¿
²»Ò»¶¨ÒªÓÃPIL¿â£¬ÈκÎÄÜʵÏÖÕâ¸ö¹¦Äܵķ½·¨¶¼ÐС£
ͼƬÇиîµÄjs²»ÊǺܶàÂð£¿
......
È磺
def aa(i):
print i
a=[1,2,3]
b=2
c=3
ÄÜʶ±ð³öÆðʼλdef aa(i):
ºÍ½áÊøÎ»" a=[1,2,3]"£¿
ÏñPython¶ÔÓï·¨ÕâôҪÇóÑϸñµÄÎÒ¾õµÃ¾Í²»ÒªÓÃÕýÔòÁË£¬Ð§Âʲ»¸ß¡£Ö±½ÓÓÃÅжϾͿÉÒÔÁË£¬Î ......
СµÜ½Ó´¥python 2¸öÐÇÆÚÁË£¬°²×°µÄÊÇpython3.1°æ¡£
ÎÒÓõÄÊÇwindows7£¬Ïëд¸öµ÷ÓÃdllµÄ³ÌÐòʵ¼ù¡£ÎÊÌâÀ´ÁË£º
C++´úÂ룺
extern "C" int __stdcall test();
int __stdcall te ......