Hello. This mailing list is to work on developing Python (adding new features to Python itself and fixing bugs); if you're having problems learning, understanding or using Python, please find another forum. Probably python-list/comp.lang.python mailing list/news group is the best place; there are Python developers who participate in it; you may get a faster, and probably more complete, answer there. See http://www.python.org/community/ for other lists/news groups/fora. Thank you for understanding.
On Mon, Oct 30, 2017 at 05:41:20PM -0200, Carlos Eugenio <ceduge...@gmail.com> wrote: > ============================================================== > SQLITE3 Function > > def get_db(): > def dict_factory(cursor, row): > d = {} > for idx, col in enumerate(cursor.description): > d[col[0]] = row[idx] > return d > > db = getattr(g, '_database', None) > if db is None: > db = g._database = sqlite3.connect(DATABASE) > db.row_factory = dict_factory > return db > ================================================================ > > I try this form but isnt ok . Can I help me ? > > > import cx_Oracle > con = cx_Oracle.connect('xxxx/xxxx@xxxxxxx/xxxxxxx') > > cur = con.cursor() > cur.execute("select * from test") > > desc = [d[0] for d in cur.description] > > result = [dict(zip(dec,line))for line in cur] > > print (result) > > cur.close() > > -- > Carlos Eug??nio Oleg. -- Oleg Broytman http://phdru.name/ p...@phdru.name Programmers don't die, they just GOSUB without RETURN. _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com