trying to create a dictionary in python, using variables as a value

ronrsr ronrsr at gmail.com
Mon Nov 20 08:40:59 CET 2006


but I keep getting syntax errors on this one -



adict = {'zid': result[0][0], 'keywords': result{0][1],
'quotations':result[0][2],'citations':result[0]{3]};
zhtml.print_update_form(adict);


result [0][0] = 22L
result [0].[1] = "Agricultural Subsidies, Global Trade', '

result[0][2]] = Lazio, Rick, "Some Trade Barrier1s Won\xe2\x80\x99t
Fall," <i>The New York Times</i>, 8/9/03\\r\\n"

result[0] [3] ='In 2002, the 30 industrial nations of the Organization
for Economic Cooperation and Development spent $311 billion on domestic
agricultural subsidies, which is more than the combined gross domestic
products of all the countries of sub-Saharan Africa. The World Bank
calculated that the European Union\xe2\x80\x99s annual subsidy to dairy
farmers comes out to $913 per cow; this dwarfs sub-Saharan
Africa\xe2\x80\x99s per capita gross domestic product of
$490.\xe2\x80\x9d\\r\\n       \\r\\n       \\r\\n

result = ((22L, '((22L, 'Agricultural Subsidies, Global Trade', 'Lazio,
Rick, "Some Trade Barrier1s Won\xe2\x80\x99t Fall," <i>The New York
Times</i>, 8/9/03\\r\\n       \\r\\n       \\r\\n       ',
'\xe2\x80\x9cIn 2002, the 30 industrial nations of the Organization for
Economic Cooperation and Development spent $311 billion on domestic
agricultural subsidies, which is more than the combined gross domestic
products of all the countries of sub-Saharan Africa. The World Bank
calculated that the European Union\xe2\x80\x99s annual subsidy to dairy
farmers comes out to $913 per cow; this dwarfs sub-Saharan
Africa\xe2\x80\x99s per capita gross domestic product of
$490.\xe2\x80\x9d\\r\\n       \\r\\n       \\r\\n       '),)n       ',
'\xe2\x80\x9cIn 2002, the 30 industrial nations of the Organization for
Economic Cooperation and Development spent $311 billion on domestic
agricultural subsidies, which is more than the combined gross domestic
products of all the countries of sub-Saharan Africa. The World Bank
calculated that the European Union\xe2\x80\x99s annual subsidy to dairy
farmers comes out to $913 per cow; this dwarfs sub-Saharan
Africa\xe2\x80\x99s per capita gross domestic product of
$490.\xe2\x80\x9d\\r\\n       \\r\\n       \\r\\n       '),)


thanks again for your wonderful assistance.

bests, 

-rsr-




More information about the Python-list mailing list