Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-13 Thread David Hutto
On Wed, Oct 13, 2010 at 9:27 AM, Steven D'Aprano wrote: > On Thu, 14 Oct 2010 12:13:50 am David Hutto wrote: >> I see it now. I knew that the u outside ' ' is the coding for the >> string, but I thought I had to strip it before using it since that >> was how it showed up. The bug of course would b

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-13 Thread Steven D'Aprano
On Thu, 14 Oct 2010 12:13:50 am David Hutto wrote: > I see it now. I knew that the u outside ' ' is the coding for the > string, but I thought I had to strip it before using it since that > was how it showed up. The bug of course would be that graphs that > start with u would go to the second lette

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-13 Thread David Hutto
On Wed, Oct 13, 2010 at 8:17 AM, Joel Goldstick wrote: > > > On Wed, Oct 13, 2010 at 4:01 AM, Alan Gauld > wrote: >> >> "David Hutto" wrote >> >>> Below is the output before converting: >>> >>> [(u'.hjvkjgfkj/bdgfkjbg', u''), (u'uuz', u'Pie >>> Chart'), (u'jgkgyckghc', u''),

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-13 Thread Joel Goldstick
On Wed, Oct 13, 2010 at 4:01 AM, Alan Gauld wrote: > "David Hutto" wrote > > Below is the output before converting: >> >> [(u'.hjvkjgfkj/bdgfkjbg', u''), (u'uuz', u'Pie >> Chart'), (u'jgkgyckghc', u''), (u'kfhhv ', u''), (u'khfhf', u''), >> (u'test', u''), (u'test10', u''), (

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-13 Thread Alan Gauld
"David Hutto" wrote Below is the output before converting: [(u'.hjvkjgfkj/bdgfkjbg', u''), (u'uuz', u'Pie Chart'), (u'jgkgyckghc', u''), (u'kfhhv ', u''), (u'khfhf', u''), (u'test', u''), (u'test10', u''), (u'test2', u'Dashed/Dotted'), (u'test3', u'Pie Chart'), (u'test346w4

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-12 Thread David Hutto
Quick note: forgot to add that the initial db file is setup with the following: import sqlite3 as lite class db(object): def onNewProjSQLDB(self): self.con = lite.connect('/home/david/pythonfiles/pythonscripts/roughdraftapps/dataplot3/db/dpdb.db') self.cur

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-12 Thread David Hutto
On Tue, Oct 12, 2010 at 10:23 AM, Alan Gauld wrote: > > "David Hutto" wrote > >> > Did you include an ORDER BY? >> >> See three posts above, line 6. > > Looks like our posts crossed in transit :-) > > So you order by graphname, and you only have a single field of that name? > But then when you pu

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-12 Thread Joel Goldstick
On Tue, Oct 12, 2010 at 10:23 AM, Alan Gauld wrote: > > "David Hutto" wrote > > > Did you include an ORDER BY? >> >> See three posts above, line 6. >> > > > Just a guess. You strip the letter u from your list items. Is there a letter u in each of them? You are sorting on the item before you s

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-12 Thread Alan Gauld
"David Hutto" wrote > Did you include an ORDER BY? See three posts above, line 6. Looks like our posts crossed in transit :-) So you order by graphname, and you only have a single field of that name? But then when you put it into the list you only use part of graphname converted to a st

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-12 Thread David Hutto
> > Did you include an ORDER BY? See three posts above, line 6. > > > -- > Alan Gauld > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > > > ___ > Tutor maillist  -  tu...@python.org > To unsubscribe or change subscription options: >

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-12 Thread Alan Gauld
"David Hutto" wrote My question is, why is everything except [:-2] in alphabetical order? It doesn't really matter(at this point), for my purposes, but I'd like to know when they changed the abc's to xy;z's? Without seeing the SQL we can't be sure. By default SQL does not guarantee any ord

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-12 Thread David Hutto
On Tue, Oct 12, 2010 at 9:02 AM, David Hutto wrote: > Sorry about that, I there might have been an obvious reason. > *Note that the I invented the *.bob file before you replied. Apparently, I am to .bob, what Al Gore is to the internet. > > import sqlite3 as lite > class db(object): >        def

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-12 Thread David Hutto
No trickery, I've been adding entries at random all day(scout's honor ii||i). But the above shows the code I used, and the first shows the entries added at random while testing and retrieving, and it shows it alphabetically any other time. I thought it might have to do with a character or several i

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-12 Thread David Hutto
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/datapl

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-12 Thread Steven D'Aprano
On Tue, 12 Oct 2010 10:41:36 pm David Hutto wrote: > When calling a sqlite3 db file in python 2.6 on Ubuntu, I get the > following when the items are taken from the db tuple, lstripped('u'), > and added to a list. > > ['.hjvkjgfkj/bdgfkjbg', 'uuz', 'jgkgyckghc', > 'kfhhv ', 'khf

Re: [Tutor] SQLite3 DB Field Alphabetizing

2010-10-12 Thread bob gailer
On 10/12/2010 7:41 AM, David Hutto wrote: When calling a sqlite3 db file Calling? How did you do that? I presume a sql select statement. True? If so please post the statement. Else what do you mean by call? in python 2.6 on Ubuntu, I get the following when the items are taken from the db

[Tutor] SQLite3 DB Field Alphabetizing

2010-10-12 Thread David Hutto
When calling a sqlite3 db file in python 2.6 on Ubuntu, I get the following when the items are taken from the db tuple, lstripped('u'), and added to a list. ['.hjvkjgfkj/bdgfkjbg', 'uuz', 'jgkgyckghc', 'kfhhv ', 'khfhf', 'test', 'test10', 'test2', 'test3', 'test346w43', 'test4'