aiwarrior wrote:
> [...]
> What i'm going to study is whether it's possible to evaluate if a
> table already exists, and if so act accordingly. [...]
You can use a statement like "CREATE TABLE IF NOT EXISTS tbl(col1, col2);".
If you just want to check, you can query SQLite's schema metadata with
Ok regarding Gerhard's comment of the try, except, pass, i came to
understand that it's really bad code. And i should have referred that
i put that there be cause i was getting:
Traceback (most recent call last):
File "C:\Python25\Projects\cp.py", line 48, in
db = db()
File "C:\Python25\P
Ok regarding Gerhard's comment of the try, except, pass, i came to
understand that it's really bad code. And i should have referred that
i put that there be cause i was getting:
Traceback (most recent call last):
File "C:\Python25\Projects\cp.py", line 48, in
db = db()
File "C:\Python25\P
On Mar 29, 9:10 pm, Tim Roberts <[EMAIL PROTECTED]> wrote:
> aiwarrior <[EMAIL PROTECTED]> wrote:
> >def get_value( self, column ):
> >self.cursor.execute( "SELECT %s FROM database" % column )
> >for n in self.cursor:
> > print n
>
> I suspect you wanted "self.cursor
aiwarrior <[EMAIL PROTECTED]> wrote:
>
>I'm sorry about not saying showing the libraries. It was not on
>purpose.
You didn't make any comment on the rest of Gerhard's suggestion, nor does
it appear that you took any action to correct them.
You should get out of the habit of using extra parenthese
after executing insert
do conection.commit()
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 29, 6:41 pm, Gerhard Häring <[EMAIL PROTECTED]> wrote:
> Ok, I'll review your code.
>
> aiwarrior wrote:
> > class db:
> > def __init__(self): #constructor
> > conn = sqlite3.connect('./db.db')
> > conn.isolation_level = None
>
> Autocommit mode is mostly for newbies who
Ok, I'll review your code.
aiwarrior wrote:
> class db:
> def __init__(self): #constructor
> conn = sqlite3.connect('./db.db')
> conn.isolation_level = None
Autocommit mode is mostly for newbies who forget to call commit.
Unfortunately, newbiews find enough other ways to shoot
aiwarrior <[EMAIL PROTECTED]> wrote:
> When i execute this the database doesn't get filled with anything and
> the program stays running in memory for ever.
That's odd, when I execute the code you posted I just get "NameError:
global name 'sqlite3' is not defined". You should always try to post