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))
ºÇºÇ,ºÍÎÒÒ»ÑùÒ²ÔÚѧÕâ½ÚÄØ
{{
Ïà¹ØÎÊ´ð£º
ÇëÎÊÏ£¬ÎÒµÄÊÇpython2.5°²×°ÁËPILÄ£¿é£¬È»ºó±àд³ÌÐò´ò¿ª±¾»úÉϵÄÒ»¸öͼƬʱ£¬ÎªÊ²Ã´ÀϳöÏÖ´íÎóÄØ£¬ÀÏÊÇÕÒ²»µ½Í¼Æ¬£¬´íÎóÌáʾÈçÏ£ºFile "C:\Python25\Lib\site-packages\PIL\Image.py", line 1888, in o ......
ÓźñµÄ¸å³ê£¬³ÏÕÐPython¼¼ÊõÈËÔ±²ÎÓë¸÷ÖÖ¼¼ÊõÊé¼®³ö°æ¡£
ͨ¹ý¸ÃÊé¼®£¬×÷Õß¿ÉÒԵõ½Èçϱ¨³ê£º
1¡¢·áºñµÄ¸å³ê¡£
2¡¢Êé¼®Öø×÷µÄÊðÃûȨ¡£
3¡¢¶Ô×÷ÕߺÍÊé½øÐÐÐû´«£¬Ìá¸ß×÷ÕßÔÚ¼¼ÊõȦ×ÓÀ ......
>>> x=-1
>>> if x>0:
print ('11')
>>> else:
SyntaxError: invalid syntax (<pyshell#20>, line 1)
ÍøÉÏËѵÄÒ²ÊÇ£º
>>> x=int(input("Please ent ......
C#ÀïÃæÓÃusing System.Security.Cryptography; RSACryptoServiceProvider¼ÓÃܹýµÄÏûÏ¢
ÓÃPython CryptoÖÐRSAµÄ·½·¨ ÄÜÖ±½Ó ½âÂð£¿
RSA¼ÓÃÜ·½Ê½²»ÊÇͳһµÄÂð£¿ÐèҪעÒâЩʲô£¿
ÓаïÖú¡£µ«ÊÇû½â¾öÎÊÌâ¡£¡£¡£
......
СµÜ½Ó´¥python 2¸öÐÇÆÚÁË£¬°²×°µÄÊÇpython3.1°æ¡£
ÎÒÓõÄÊÇwindows7£¬Ïëд¸öµ÷ÓÃdllµÄ³ÌÐòʵ¼ù¡£ÎÊÌâÀ´ÁË£º
C++´úÂ룺
extern "C" int __stdcall test();
int __stdcall te ......