Sep-29-2016, 01:41 PM
Hello,
I'm quite new to python and am attempting to do some coding on a Raspberry Pi.
I have a sensor that gives an output in the following format.
628.6,339,0.30,1.000
I need to splice it so it just gives me the 628.6
The string isn't always the same length so i need to chop it on the first comma.
I also need to change the decimal point so it looks like this but that should be easy enough once its just a number.
6.286
Thanks
I'm quite new to python and am attempting to do some coding on a Raspberry Pi.
I have a sensor that gives an output in the following format.
628.6,339,0.30,1.000
I need to splice it so it just gives me the 628.6
The string isn't always the same length so i need to chop it on the first comma.
I also need to change the decimal point so it looks like this but that should be easy enough once its just a number.
6.286
Thanks