Q:

python: how to convert list of tuples to numpy array

I have list of tuples (x,y coordinates) converted to a string and written in a file.  When I read line from file, my list looks like this: 
[(341, 115), (174, 227), (457, 308)]

how do I convert this kind of list to numpy array?  end result should look like this:
[[341 115]
 [174 227]
 [457 308]]

A:

Using numpy:
lst = [(341, 115), (174, 227), (457, 308)]

import numpy as np
print(np.array(lst))

OUTPUT:
[[341 115]
 [174 227]
 [457 308]]

Using list comprehension:
print([list(lst) for lst in lst])

OUTPUT:
[[341, 115], [174, 227], [457, 308]]

EDIT:
If it is a string which it does not look like in the code pasted in the question:
lst = "[(341, 115), (174, 227), (457, 308)]"

Then:
import numpy as np
from ast import literal_eval
print(np.array(literal_eval(lst)))

Eventually (for list comprehension):
print([list(lst) for lst in literal_eval(lst)])

