I will try to keep this as suscinct as possible as it might be an
obvious Q.
I am just getting into Py/sqlite (with a fair amount of PHP/MySQL
background), and am posting this as much for the other noobs as
myself
I started learning sqlite by tinkered around at the command line:
creating db
Dennis Lee Bieber wrote:
> That is probably the worst way to "fix" the problem -- as in the
> future, you may end up trying that method for something that may need to
> be quoted or escaped.
>
> cur.execute(template, (arg1,) )
>
> allows the DB-API spec to properly convert the argument
Thanks everyone!
But... RTFM? Ouch. It's not like I don't know what I'm doing :-(
... rather, that I *am* using the older sqlite module
> print sqlite.paramstyle = pyformat
> print sqlite.version = 1.0.1
which does not support the qmark sytax. (and I fell victim of
someone elses tutor
foo (id) VALUES (?)", num)
I get the error...
Traceback (most recent call last):
File "/home/rdrink/Programming/Python/Inner_Square/sqlite_test.py",
line 46, in ?
cur.execute("INSERT INTO foo (id) VALUES (?)", num)
File "/usr/lib/python2.4/site-packages/sqlite/ma
Thanks everyone for you thoughtful replies...
And yes Simon you are right... I do need to learn how to read
'tracebacks' (and de-bugging tools in general)... but you are the first
person to give me a step-by-step explination, thank you.
And LOL you all caught my dropped single-quote ;-)
but
Ok, maybe now I can make some more sense of this, with an example of
real code (sorry if it's a bit dense):
This is the basic function...
def equate(parts,new_eq):
oL = int(parts[0])
iL = int(parts[1])
iR = int(parts[2])
oR = int(parts[3])
oLoL = int(str(o
Hey Simon, Thanks for the reply.
Simon Forman wrote:
> You must be doing something weird, that equation works for me:
> Try posting the minimal code example that causes the error and the
> full, exact traceback that you get.
I appreciate the offer... but at this point my code is too recursive
an
n.n.h. (noob needs help)
Ok, I've been beating my head against this for a day... time to ask
others.
To explain things as simply as possible:
I am trying to use eval() to evaluate some simple equations, such as--
pow(AB,2)
pow(AB,2)+A
pow(A+B,2)
pow(A+B,2)+A
and so forth... for a variety of math o