#制作標識為
dd = 2
#如果不相等,則重置時間序號
last_data_number = data_number = 0
#處理生成的文件路徑數字超過4位
rebulid_number = \"%04d\" % int(str((int(last_data_number)+last_count))[-4:])
rebulid_path = self.initialization_path+self.data_prefixion+data_time+self.data_infix+rebulid_number+self.data_postfix
#從初始化路徑中得到數據
tel_node = open(self.data_path,\"r\")
tel_node_new = open(rebulid_path,’w’)
tel_list = tel_node.readlines() [Page]
for i in range(len(tel_list)):
#數據的第一行
new_list = tel_list[i].split(’,’)
for j in range(len(tel_list[i].split(’,’))):
#賽選存在日期的序列,i等于時間片序列的縱行位置
if ’/’ in tel_list[i].split(’,’)[j]:
#從原始列表中刪除原始日期
new_list.remove(tel_list[i].split(’,’)[j])
#替換重新組合的日期時間
time_area = self.get_localtime()
new_list.insert(j,time_area)
#得到新的數據列表print new_list
#合成數據從列表中讀出數據添加分割符
new_string = \"\"
for i in new_list:
new_string += str(i)+’,’
#print new_string[0:-1]
tel_node_new.writelines(new_string[0:-1])
count += 1 [Page]
print \"Execute!count=%s,current_time=%s,current_number=%s\" % (count,data_time,rebulid_number)
log_path = open(\".//config//run_log.txt\",’w’)
log_path.writelines(\"Execute!count=%s,current_time=%s,current_number=%s\" % (count,data_time,rebulid_number))
time.sleep(10)
if __name__ == \"__main__\":
control = DataBase()
print \"測試前請先核對您的文件路徑是否正確!\"
print control.data_path
choose = raw_input(\"確認請輸入OK:\")
print \"程序開始執行\"
control.data_control()
文章來源于領測軟件測試網 http://www.kjueaiud.com/