#apache #archlinux #asterisk #centos #debian #gentoo #haskell #kde #kubuntu #lisp #math #mysql #perl #python #ruby-lang #rubyonrails #suse #ubuntu #vim #wikipedia 0 1 2 3 4 5 6 7 8 9 10 11 12 13 
Top Prev 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 Next

#python

<SevenInchBread> preferably as a list?
<guido_g> nope, you've to do it yourself
<SevenInchBread> hmph.
<guido_g> __init__ module are like __init__ for instances
<guido_g> they just initialize their surrounding thing, a package in this case
<SevenInchBread> heh... but __init__ in instances contain references to themselves.
<SevenInchBread> bad analogy. ;)
<guido_g> yep
<plainas> i am inserting data on a mysql database with MySQLdb.executemany() and i am letting a mysql index take care of duplicates. But once a query fails the whole thing stops
<guido_g> and?
<plainas> and i want the INSERT instructions that dont have a duplicate value to be executed successfully
<guido_g> a) not python related b) put every insert in one transaction
<plainas> aparently executemany() only works if all the sql queries are valid
<plainas> i think is python related, more precisly MySQLdb module
<plainas> about b)....
<guido_g> nope, just plain sql
<plainas> no
<plainas> the sql is correct
<guido_g> if you've no clue, don't even try to argue
<plainas> what do you mean? this works if no duplicate entries are found
<guido_g> you know what a transaction is?
<plainas> yes i know very well
<guido_g> then apply this this knowledge to the behaviour you described
<guido_g> problem solved
<plainas> ?? mysql 4 doesnt even suport transactions
<Jerub> plainas: it does, with innodb
<plainas> i thought innodb only added integrity checking to a mysql database up to version 4...
<guido_g> *sigh*
<plainas> but i am not sure about that... anyway, let me check the documentation for mysqldb modules
<guido_g> don't forget http://www.python.org/dev/peps/pep-0249/
<plainas> guido_g it doesn't say that it performas a transaction
<guido_g> otoh, the docs say that executemany might use db-specific functions
<guido_g> which in this case might be the reason that it fails
<guido_g> afaik there is a multi-row insert in mysql... check for that
<vbgunz> when I interact with a python script on the console, the history of what I was doing is easily viewable by just scrolling up... is there a way to remove that without having to restart console?
<plainas> ok, i don't want to insist about somthing i am not shure nor into deep knowledge
<plainas> i have just changed my code, using execute() now
<guido_g> *sigh*
<timonator> vbgunz: your terminal should supply you with a hotkey that clears it
<timonator> ctrl-l maybe?
<vbgunz> Iam using Konsole
<vbgunz> I'll check
<vbgunz> come to think about it, I'd rather the script be able to do it
<vbgunz> I'll search for the idea
<guido_g> what about good ol' "reset"?
<guido_g> like os.system('reset')
<vbgunz> yeah, that doesn't work
<vbgunz> if I scroll up, its still there
<guido_g> use xterm! :)
<vbgunz> heh, I like Konsole, I am trying to find a way for the script to do it. would be nice if it could be cross platform without checking for win, nix, etc :)

Previous Page  Next Page

Search ircarchive.info