摘要:
#!/usr/bin/pythonimport osimport timesource=['/root/perl-demo','/root/perl-gongju']target_dir='/root/backup/'target=target_dir+time.strftime('%Y%m%d%H%M%S')+'.zip'zip_command="zip -qr '%s' %s" % (target,' '.join(source))if os.system(z 阅读全文
摘要:
#!/usr/bin/pythonab={ 'jack' : 'jack@1.com', 'ken' : 'ken@1.com', 'hellen' : 'hellen@1.com' }print 'jack address is %s' % ab['jack']ab['sten']='sten@1.com'del ab['ken']print '\nTHere are %d conntacts in the a 阅读全文
摘要:
练习List的使用。。有点旧,不过复习下,很多都掌握不牢固。。。#!/usr/bin/pythonshoplist=['apple','jack','banane']print 'shoplist have',for i in shoplist: print i,print '\ni buy the shop:kate'shoplist.append('kate')print '\nthe shoplist have:',for i in shoplist: print i,prin 阅读全文