Your description of the text file format is rather sketchy, so I will assume that each row is represented with a starting and ending square bracket and the individual values are separated by commas with optional whitespace around them. This means the first character and the last two (there's a newline, too) should be ignored. My file looked like this:
[1, 3, 5, 7, 9]
[3, 5, 7, 9, 11]
[5, 7, 9, 11, 13]
The following code generates an array according to the dimension of the file rather than using set values, but hopefully this will get you on your way.
def selectedArray(intLength,intWidth):
arr = []
selected = open('ArrayValues2.txt','r')
for line in selected:
values = [float(f.strip()) for f in line[1:-2].split(',')]
arr.append(values)
return arr
for row in selectedArray(3, 5):
print(row)
The output is
[1.0, 3.0, 5.0, 7.0, 9.0]
[3.0, 5.0, 7.0, 9.0, 11.0]
[5.0, 7.0, 9.0, 11.0, 13.0]