Re: Trying to work with data from a query using Python.

2013-06-07 Thread Walter Hurry
On Fri, 07 Jun 2013 14:24:30 -0400, Dave Angel wrote: > On 06/07/2013 01:44 PM, ethereal_r...@hotmail.com wrote: >> > >> >> rows = cur.fetchall() >> >> for row in rows: >> print row >> >> >> >> >> Now assume that fetchall would print the following: > > I doubt if fetchall(

Re: Trying to work with data from a query using Python.

2013-06-07 Thread Peter Otten
ethereal_r...@hotmail.com wrote: > Hello, I'm working with PostgreSQL and Python to obtain 2 columns froma > database and need to print it in a specific format. > > Here is my current code. > > > > #!/usr/bin/python > # -*- coding: utf-8 -*- > > import psycopg2 > import sys > > con = None >

Re: Trying to work with data from a query using Python.

2013-06-07 Thread Dave Angel
On 06/07/2013 01:44 PM, ethereal_r...@hotmail.com wrote: rows = cur.fetchall() for row in rows: print row Now assume that fetchall would print the following: I doubt if fetchall() prints anything. presumably it returns something, extracted from the db. LOEL

Trying to work with data from a query using Python.

2013-06-07 Thread ethereal_robe
Hello, I'm working with PostgreSQL and Python to obtain 2 columns froma database and need to print it in a specific format. Here is my current code. #!/usr/bin/python # -*- coding: utf-8 -*- import psycopg2 import sys con = None try: con = psycopg2.connect(database='DB', user='ME