I have a simple python module as follows:
from kafka import KafkaConsumer
consumer = KafkaConsumer(
'myTestTopic',
bootstrap_servers=['localhost:9092'],
auto_offset_reset='earliest',
enable_auto_commit=True)
for message in consumer:
message = message.value
print(message)
This will return something like follows:
b'&name=bob&gender=M&type=student&sId=1204¬e=temp&'
b'&name=bob&gender=M&type=student&sId=1204&'
My question is: Is there a neat way to remove/trim the first two characters e.g: (b') and the last character (') from each line that will be returned?
So essentially it will appear like:
&name=bob&gender=M&type=student&sId=1204¬e=temp&
&name=bob&gender=M&type=student&sId=1204&