[Generateds-discuss] Help - people_api.py example giving 'b' outputs
Brought to you by:
dkuhlman
|
From: Dewitte, D. W (US) <dan...@ba...> - 2022-05-25 14:59:32
|
Good Morning,
I am starting to learn GenerateDS for a project and I am using your people_api.py example in the tutorial section 6.2. Everything works after some finagling, but my output looks like this in the Spyder Console:
<peopleType>
<person id="1">
<name>b'albert'</name>
</person>
<person id="2">
<name>b'betsy'</name>
</person>
<person id="3">
<name>b'charlie'</name>
</person>
</peopleType>
I am trying to figure out how to remove the "b" prefix from the names. From everything that I can read is that the names are being represented as a byte object. How do I remove the prefix?
I tried adding the <str>.decode("utf-8") in the for loop but that didn't work.
Any help would be appreciated,
Daniel DeWitte
|