Cleaning up list selected from mysql database
Posted on 2015-01-16
I need to store lists which are generated by an order entry program. The lists take the form of
[[2, 25, 1], [1, 26, 2], [1, 27, 3], [1, 29, 10]] .... an example of such a list.
I am able to insert these lists into my database and then select them when required. Problem is that the selected lists
are always front ended and back ended by 'noise'. [(b' is appended to the start of the selected list and ',)] to the end. (note, the noise at the front and back is different as show above... not a typo) This is shown below
[(b'[[2, 25, 1], [1, 26, 2], [1, 27, 3], [1, 29, 10]]',)]
Is is possible to trim the list to remove the noise ? All the lists stored have exactly the same noise attached - regardless of their size.