python code for debug data lost
This commit is contained in:
@@ -1,7 +1,25 @@
|
||||
import re
|
||||
def main():
|
||||
file = open('C:/ti/python_test_code/uni/att_notify.psd', 'r')
|
||||
print(file.read())
|
||||
file.close()
|
||||
with open('C:/Users/yichin/Downloads/last-2019-07-18-08-08-57-7.csv', 'r') as f:
|
||||
readlines = f.readlines()
|
||||
delimiters = ",", "#", "\n"
|
||||
|
||||
for line in readlines:
|
||||
Types = re.split(', |# |\n', line)
|
||||
time_index = []
|
||||
data_index = []
|
||||
for i in range(len(Types)):
|
||||
for j in range(len(Types[i])):
|
||||
if Types[i][j] == "time[ms]":
|
||||
time_index.append(j)
|
||||
if Types[i][j] == "voltage[mV]":
|
||||
data_index.append(j)
|
||||
index = i
|
||||
print(Types[index])
|
||||
print(time_index, data_index)
|
||||
print(Types[index][time_index[0]])
|
||||
f.close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import unittest
|
||||
import random
|
||||
from random import randint
|
||||
from typing import List, Optional
|
||||
|
||||
|
||||
Reference in New Issue
Block a user