From: Michael W. <wa...@tr...> - 2002-06-13 01:43:05
|
Close... from pyPgSQL import PgSQL dsn = 'dbname=yourdb user=youruser host=yourhost' db = PgSQL.connect(dsn) cursor = db.cursor() and now... cursor.execute("select * from something") result = cursor.fetchall() for row in result: print row.acolumn, row.anothercolumn happy experimenting... Mike At 09:30 PM 6/12/2002 -0400, Dave Strickler wrote: >You're gonna think I'm whacko, but actually, I have read those docs. What >I'm missing, is what do I load ( I think its "import PgSQL") so that I can >use the connect command etc. > >When I start up Python, it doesn't understand any of the pypgsql commands, >and I assume that's b/c I need to load a library... |