标签:false style oca ftime 时间 self time test open
class HangUp(object): current_path = os.getcwd() test_path = current_path + r‘/log/‘ log_name = test_path + time.strftime(‘%Y-%m-%d %H-%M-%S‘) + ".log" nowtime = time.time() def write_log(self, string, false_time=0.0, data=1814400.0): with open(self.log_name, "a") as f: save_time = time.strftime(‘%Y-%m-%d %H:%M:%S‘, time.localtime(self.nowtime - data + false_time)) print(save_time + ": " + string) f.write(‘\r\n‘ + save_time + ": " + string) f.close()
修改LOG时间
标签:false style oca ftime 时间 self time test open
原文地址:https://www.cnblogs.com/gexbooks/p/12658616.html