OS = RHEL 5.4 32Bit
Python = 2.4.3
#! /usr/bin/env python
import pgdb, sys
db = pgdb.connect (dsn='192.168.0.1:familydata',
user='postgres', password='')
cursor = db.cursor ()
cursor.execute ("select * from names")
rows = cursor.fetchall ()
for i in (rows):
print i
#viewtable (db)
#sys.stdout.write()
cursor.close ()
###########END########
The code as is will display the data to the console. I have read the
db API 2.0 at python.org. The problem is viewtable (db) will not work
or sys.stdout.write () to write the table data to the console screen.
What am I doing wrong here or what do I need to do different?
Can anyone point me to a book specificly for pgdb, python and postgre?
Last thing is can I define the classes in a separate files and
reference them? Kinda like code reuse in .Net? I new to Python so
bear with me.
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor