toTo convert a stringstring having the form a="[[1, 3], [2, -6]]"a="[[1, 3], [2, -6]]" I wrote yet not optimized code:
matrixAr = [] mystring = "[[1, 3], [2, -4], [19, -15]]" b=mystring.replace("[[","").replace("]]","") # to remove head [[ and tail ]] for line in b.split('], ['): row =list(map(int,line.split(','))) #map = to convert the number from string (some has also space ) to integer matrixAr.append(row) print matrixAr