|
Re: Coding when open conection: msg#00018python.db.psycopg.devel
Oswaldo Hernández wrote: Hi all, Why don't you use exceptions ?? : import sys import psycopg try: con = psycopg.connect("dbname=leonel user=leonel") except StandardError, error: print "no se conecto" sys.exit(2) cur=con.cursor() cur.execute("select * from test") con.commit() con.close() If there's an error will stop printing "no se conecto" Leonel |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Coding when open conection: 00018, Federico Di Gregorio |
|---|---|
| Next by Date: | [psycopg] #104: infooo.com: 00018, psycopg |
| Previous by Thread: | Re: Coding when open conection (+- Solved)i: 00018, Oswaldo Hernández |
| Next by Thread: | Re: Coding when open conection: 00018, Oswaldo Hernández |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |