Python学习搬家啦

发现163的博客,还是不太适合写技术类的东西,特别是代码处理的很不舒服,就搬迁到这里了,学习继续进行。

添加一段代码试试:

 1 def run_tc(tc_folder, output_folder, case_name, env_name, parameters, logfile):   
 2     """
 3     run a test case
 4     return: result in a string
 5     """
 6     # check Python version
 7     if sys.version_info[:2] < (2,7):
 8         print("Current Python verion "+sys.version.split()[0]+" is not supported, please use 2.7 or higher")
 9         sys.exit()
10     
11     output_folder=os.path.abspath(output_folder)
12     tc_folder=os.path.abspath(tc_folder)
13     
14     # change working directory to where the test case loacted
15     os.chdir(os.path.join(tc_folder, os.path.split(case_name)[0]))
16     
17     # initialize log
18     log_format="%(asctime)s %(levelname)-8s %(name)-8s %(message)s"
19     logging.basicConfig(format=log_format, level=logging.DEBUG)

 

posted on 2015-03-26 21:14  nasduc  阅读(202)  评论(0编辑  收藏  举报

导航