I need to obtain values that are contained in a string of type str separated by a "," and that when I find the comma, save that value in a new variable for example, I have the string:
10.90,500,56.99
and I want to save the values in a new variable a = 10.90 b = 500 c = 56.99
This is my code
import serial, time
launchpadPort=serial.Serial('COM6', 9600, timeout=1)
while True:
#datosLaunchpad = open("datos.csv", 'a')
getSerialValue = launchpadPort.readline()
b = getSerialValue.decode('utf-8').rstrip('\n')
print(f"Prueba: {b}")
datosLaunchpad.write(b)
print(type(b))