The problem: I have to convert a list of strings of tuples into a normal list of tuples. The reason is that I want to plot the (x,y) coordinates over an image.
I tried map
,join
, unzipping it, int()
, float()
but nothing seems to work. If I try the most logical way, using int()
I get the following error:
ValueError: invalid literal for int() with base 10: '(50,144)'
This is my list of strings of tuples
vertices = ['(50,144)', '(242,144)', '(242,367)', '(50,367)']
type(vertices) >> list
type(vertices[0]) >> str