#importing serial module(need pyserial)
import serial

try:
  arduino = serial.Serial(timeout = 1, baudrate = 9600)
except:
  print('Check port')
  
rawData = []

def clean(L):
  newl = []
  
  for i in range(len(L)):
      temp = L[i][2:]
      newl.append(temp[:-5])
  return newl

cleanData = clean(rawData)

#write to file function
def write(L):
  file = open("data.txt", mode = 'w')
  
  for i in range(len(L)):
    file.write(L[i] + '\n')
    
  file.close()
  
#currently receives data indefinitely
while True:
  rawData.append(str(arduino.readline()))

write(cleanData)  


4aea5ce6c195f5b9a72299166118bb96c984b8a5
<mask token>


def clean(L):
    newl = []
    for i in range(len(L)):
        temp = L[i][2:]
        newl.append(temp[:-5])
    return newl


<mask token>


def write(L):
    file = open('data.txt', mode='w')
    for i in range(len(L)):
        file.write(L[i] + '\n')
    file.close()


<mask token>

<mask token>
try:
    arduino = serial.Serial(timeout=1, baudrate=9600)
except:
    print('Check port')
<mask token>


def clean(L):
    newl = []
    for i in range(len(L)):
        temp = L[i][2:]
        newl.append(temp[:-5])
    return newl


<mask token>


def write(L):
    file = open('data.txt', mode='w')
    for i in range(len(L)):
        file.write(L[i] + '\n')
    file.close()


while True:
    rawData.append(str(arduino.readline()))
write(cleanData)

<mask token>
try:
    arduino = serial.Serial(timeout=1, baudrate=9600)
except:
    print('Check port')
rawData = []


def clean(L):
    newl = []
    for i in range(len(L)):
        temp = L[i][2:]
        newl.append(temp[:-5])
    return newl


cleanData = clean(rawData)


def write(L):
    file = open('data.txt', mode='w')
    for i in range(len(L)):
        file.write(L[i] + '\n')
    file.close()


while True:
    rawData.append(str(arduino.readline()))
write(cleanData)

import serial
try:
    arduino = serial.Serial(timeout=1, baudrate=9600)
except:
    print('Check port')
rawData = []


def clean(L):
    newl = []
    for i in range(len(L)):
        temp = L[i][2:]
        newl.append(temp[:-5])
    return newl


cleanData = clean(rawData)


def write(L):
    file = open('data.txt', mode='w')
    for i in range(len(L)):
        file.write(L[i] + '\n')
    file.close()


while True:
    rawData.append(str(arduino.readline()))
write(cleanData)

#importing serial module(need pyserial)
import serial

try:
  arduino = serial.Serial(timeout = 1, baudrate = 9600)
except:
  print('Check port')
  
rawData = []

def clean(L):
  newl = []
  
  for i in range(len(L)):
      temp = L[i][2:]
      newl.append(temp[:-5])
  return newl

cleanData = clean(rawData)

#write to file function
def write(L):
  file = open("data.txt", mode = 'w')
  
  for i in range(len(L)):
    file.write(L[i] + '\n')
    
  file.close()
  
#currently receives data indefinitely
while True:
  rawData.append(str(arduino.readline()))

write(cleanData)  

