Strange Problem

Victor Subervi victorsubervi at gmail.com
Tue Dec 22 13:57:00 EST 2009


Hi;
I have the following code:

  print 'printTheForm: ', descrProds, '<br />'
  for value in descrProds:
    print 'value: ', value, '<br />'

which prints this:

printTheForm: [['ID', 'tinyint', '5', '0', None], ['SKU', 'varchar', '40',
'', None], ['Category', 'varchar', '40', '', None], ['Name', 'varchar',
'50', '', None], ['Title', 'varchar', '100', '', None], ['Description',
'mediumtext', '100', '', None], ['Price', 'float', '8', '0.0', None],
['SortFactor', 'int', '4', '0', None], ['Availability', 'tinyint', '1', '0',
'1'], ['OutOfStock', 'tinyint', '1', '0', '0'], ['ShipFlatFee', 'float',
'5', '0.0', '0.00'], ['ShipPercentPrice', 'tinyint', '2', '0', '0'],
['ShipPercentWeight', 'tinyint', '2', '0', '0'], ['Associations', 'varchar',
'40', '', None], ['TempPrice', 'tinyint', '1', '0', None], ['LastDatePrice',
'date', '10', 'yyyy/mm/dd', None], ['Weight', 'float', '7', '0.0', None],
['Metal', 'enum', ['14k gold', '18k gold', 'white gold', 'silver',
'tungsten', 'titanium'], '', None], ['PercentMetal', 'tinyint', '2', '0',
None], ['colorsShadesNumbersShort', 'set', [''], '', None]]
value: ['ID', 'tinyint', '5', '0', None]
value: ['SKU', 'varchar', '40', '', None]
value: ['Category', 'varchar', '40', '', None]
value: ['Name', 'varchar', '50', '', None]
value: ['Title', 'varchar', '100', '', None]
value: ['Description', 'mediumtext', '100', '', None]
value: ['Price', 'float', '8', '0.0', None]
value: ['SortFactor', 'int', '4', '0', None]
value: ['Availability', 'tinyint', '1', '0', '1']
value: ['OutOfStock', 'tinyint', '1', '0', '0']
value: ['ShipFlatFee', 'float', '5', '0.0', '0.00']
value: ['ShipPercentPrice', 'tinyint', '2', '0', '0']
value: ['ShipPercentWeight', 'tinyint', '2', '0', '0']
value: ['Associations', 'varchar', '40', '', None]
value: ['TempPrice', 'tinyint', '1', '0', None]
value: ['LastDatePrice', 'date', '10', 'yyyy/mm/dd', None]

You'll notice that the first print statement prints out several tuples that
don't get printed out in the last statement (they're truncated). Why?
TIA,
beno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091222/fa150f43/attachment.html>


More information about the Python-list mailing list