摘要:        
commands 模块包含一些用于执行外部命令的函数. Example 3-7展示了这个模块.3.5.0.1. Example 3-7. 使用 commands 模块import commandsstat, output = commands.getstatusoutput("ls -lR")pri...    阅读全文
        
            posted @ 2014-01-13 14:27
前行者2011
阅读(108)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
转载地址:http://hi.baidu.com/liheng_2009/item/28525511e5061a07b88a1a5e1.用os.system(cmd)不过取不了返回值2.用os.popen(cmd)要得到命令的输出内容,只需再调用下read()或readlines()等如a=os.p...    阅读全文
        
            posted @ 2014-01-13 14:13
前行者2011
阅读(107)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
使用生成器:#coding:utf-8--使用生成器,返回小于n的元素值,myield函数返回一个生成器对象def myyiled(n): a,b=0,1 while a<n: yield a a,b=a+b,a--使用生成器,返回前n项的元素值,my函数返回...    阅读全文
        
            posted @ 2014-01-13 10:28
前行者2011
阅读(166)
评论(0)
推荐(0)
        
        
                    
                
浙公网安备 33010602011771号