Now I know this isn't a python help forum, but stay with me here…..
I have a very simple python related question but it seems either my google-fu is not great today or I'm trying to do something I'm not supposed to be able to do.
I create a 2 dimensional array and fill it with elements. this works absolutely fine
data = [[0 for a in range(2048)] for b in range(numfiles)]
for fname in dirList: with open(fname,'rb') as file:
byte = file.read(32)
data.append([])
#Skip the bit we don't need, and output the data
for x in range(0,2048):
#We know there are 2048 channels.
data[y][x]=struct.unpack('L',file.read(4))
#Convert the binary data (32bit unsigned int)
#Whilst using the Tuple output to the file
y +=1 I then want to print an element say:
print(data[0][2])
However the output is of the form:
(0,)
I really want this to output as:
0
Am I missing something simple?