0

When I retrieve data from a MySQL database with a SELECT, in Python, the data has and additional symbol b'dataa'

[(b'Avenue Motel Alexandra', 4, 99999, b'Alexandra', b'NZ', b'New Zealand', b'117 Centennial Avenue', b'Alexandra New Zealand', b'http://www.avenue-motel.co.nz/', -45.2475, 169.384)]

[(b'Avenue Motel Alexandra', 4, 99999, b'Alexandra', b'NZ', b'New Zealand', b'117 Centennial Avenue', b'Alexandra New Zealand', b'http://www.avenue-motel.co.nz/', -45.2475, 169.384)]

I want to delete that symbol b

jradich1234
  • 1,410
  • 5
  • 24
  • 29
  • Possible duplicate of [Remove 'b' character do in front of a string literal in Python 3](https://stackoverflow.com/questions/37016946/remove-b-character-do-in-front-of-a-string-literal-in-python-3) – smac89 May 16 '19 at 23:38
  • The `b'...'` is just python telling you that it's a bytes-like structure, not a normal string. With python-3, most APIs that used to return strings now return bytes-like objects. You should decode that into string using the proper encoding (UTF-8 most likely) – rdas May 17 '19 at 03:06

0 Answers0