[Tutor] How do get results shown in a table

Ms Soo Chong s4046441 at student.uq.edu.au
Wed Aug 18 05:35:35 CEST 2004


Hi all,

Anyone can guide me along with this:

Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
[GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on
linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import pg
>>> db = pg.connect("moncdata")
>>> result = db.query("""SELECT project, blame,
date_string, condition from shot_descriptions where
shot_number = 8000""")
>>> list_of_result = result.getresult()
>>> list_of_result
[('Hot inlet Scramjet testing', 'AK,MF,TM(optics)',
'4/07/03', None)]
>>> list_of_result = result.dictresult()
>>> list_of_result
[{'project': 'Hot inlet Scramjet testing', 'blame':
'AK,MF,TM(optics)', 'condition': None,
'date_string': '4/07/03'}]

I am trying to get the list_of_result shown in a
table using inserttable but failed. Anyone one can help?

Thank you in advance.

Cheers,
Shufen



More information about the Tutor mailing list