Parsing Data, Storing into an array, Infinite Backslashes

supercomputer at gmail.com supercomputer at gmail.com
Tue Jul 12 09:21:11 EDT 2005


Thanks for all the help, I'm not sure what approach I'm going to try
but I think I'll try all of your suggestions and see which one fits
best.

The variable "i" held the following array:

[['Memory', '0', 'Summary', '0'], ['Memory', '0', 'Speed',
'PC3200U-30330'], ['Memory', '0', 'Type', 'DDR SDRAM'], ['Memory', '0',
'Size', '512'], ['Memory', '0', 'Slot', 'DIMM0/J11'], ['Memory', '0',
'ConfigurationType', '2'], ['Memory', '1', 'Summary', '0'], ['Memory',
'1', 'Speed', 'PC3200U-30330'], ['Memory', '1', 'Type', 'DDR SDRAM'],
['Memory', '1', 'Size', '512'], ['Memory', '1', 'Slot', 'DIMM1/J12'],
['Memory', '1', 'ConfigurationType', '2'], ['Memory', '2', 'Summary',
'0'], ['Memory', '2', 'Speed', 'PC3200U-30330'], ['Memory', '2',
'Type', 'DDR SDRAM'], ['Memory', '2', 'Size', '512'], ['Memory', '2',
'Slot', 'DIMM2/J13'],

> Where is the fetch object defined? And what is it supposed to be
> returning?

Fetch is declared a few lines up in the program with this
fetch=iter(ed) it just goes through the array and returns the next part
of it.

>>         query[count]=qval+i[2]+"="+i[3]+", "

>Impossible to know what this does since we don't know what i is. Hint: it
>is easier to read and parse expressions by adding a small amount of
>whitespace:

I am trying to assign each new memory slot to a new part in the array.
So when memory is either 0,1,2,3 it will assign it to query[0],
query[1], query[2], query[3]




More information about the Python-list mailing list