i have program list like this,
Code: Select all
import serial import time port = serial.Serial("/dev/ttyAMA0", baudrate=600, timeout= 3.0) while True: rcv = port.read(5) value = (rcv) myString = str(value) b = open("/var/www/lampu1.txt","a") b.write(myString) b.close()
i just want to take 1 string data from the data are received and write into file.
how i can take the string data, if for example i want to take string data =9 and write into file "lampu1.txt"
anyone can help me please,