It looks like you are using a Raspberry Pi to connect the sensor. I don't know what your problem is. Is the final 'obj_Temp:28.41 ref_Temp:39.24' the obtained data result? But do you want to remove this basic string processing from 'obj'?
str = 'hello world' If you want to remove the first letter 'o' and know it is the 5th character, index=4 1. Use sharding new_str = str[:4]+str[5:] ; # str[0:4] intercept the first to fourth characters 2. Character replacement new_str = str.replace('o','') # Replace 'o' with empty space
It looks like you are using a Raspberry Pi to connect the sensor. I don't know what your problem is. Is the final 'obj_Temp:28.41 ref_Temp:39.24' the obtained data result? But do you want to remove this basic string processing from 'obj'?
str = 'hello world'
If you want to remove the first letter 'o' and know it is the 5th character, index=4
1. Use sharding new_str = str[:4]+str[5:] ; # str[0:4] intercept the first to fourth characters
2. Character replacement new_str = str.replace('o','') # Replace 'o' with empty space