Skip to content

Removing first and last punctuation from python

I have the following problem, I want to remove the punctuation marks at the beginning and at the end but leave the ones in between. Example. and this should turn So if anyone can help me, I would appreciate it Answer You could use a regular expression for this. Just import re at the start of the file, then

How to convert list array to float

I have an little endian list value in python, I get with serial line. I get this value as a byte like this: How can I convert this 4 byte (little endian) value to float ? Answer If the float is in IEEE754 format (which it very likely is), you can convert your list of numbers to a byte array