[Tutor] SQLite3 DB Field Alphabetizing
David Hutto
smokefloat at gmail.com
Tue Oct 12 15:02:52 CEST 2010
Sorry about that, I there might have been an obvious reason.
*Note that the I invented the *.bob file before you replied.
import sqlite3 as lite
class db(object):
def onNewProjSQLDB(self):
self.con = lite.connect('/home/david/pythonfiles/pythonscripts/roughdraftapps/dataplot3/projdir/basicobjb.bob')
self.cur = self.con.cursor()
self.orderbygname = self.cur.execute('''select * from %s order by
graphname''' % ('projectbob'))
self.liorder = []
for graphname in self.orderbygname:
self.liorder.append(str(graphname[0]).lstrip('u'))
print self.liorder
# Save (commit) the changes
self.con.commit()
self.cur.close()
self.con.close()
db = db()
db.onNewProjSQLDB()
More information about the Tutor
mailing list