摘要: def loginfo(info): # create logger logger = logging.getLogger('【cpu and mem】**********') # Set default log level logger.setLevel(logging.DEBUG) ch = logging.StreamHandler() ... 阅读全文
posted @ 2018-05-28 17:29 Mr,Read 阅读(332) 评论(0) 推荐(0) 编辑
摘要: file_data = '' str1 = '1' str2 = '2' with open(loginfofile, 'r+') as f: #打开文件,r+模式,读取 for line in f: if str1 in line: line = line.replace(str... 阅读全文
posted @ 2018-05-28 17:20 Mr,Read 阅读(3150) 评论(0) 推荐(0) 编辑
摘要: #-*- coding: UTF-8 -*- import argparse import sysif len(sys.argv) == 1: sys.argv.append('--help') parser = argparse.ArgumentParser() parser.add_argument('-o','--host',help="talent IP") parser.add... 阅读全文
posted @ 2018-05-28 17:15 Mr,Read 阅读(438) 评论(0) 推荐(0) 编辑