Re: [Tutor] Handling MySQLdb exceptions

2007-12-20 Thread Paul Schewietzek
Joshua Simpson schrieb: > On Dec 19, 2007 10:14 AM, Paul Schewietzek <[EMAIL PROTECTED] > > wrote: > > > Is there any way to handle this exception? As you can see, I already > tried it with _mysql_exceptions.OperationalError (the lines that are > commented o

Re: [Tutor] Handling MySQLdb exceptions

2007-12-20 Thread Paul Schewietzek
Kent Johnson schrieb: > A more robust solution would be to read the file with the csv module and > use cursor.execute() with a proper parameter list. This lets the csv and > database modules correctly (un)escape the data values. > > Kent > WOW thanks! I never thought about that there might be

[Tutor] XML data reading

2007-12-20 Thread Lockhart, Luke
Hello all, So I'm a very novice Python programmer. I've done stuff up to the intermediate level in Microsoft flavors of BASIC and C++, but now I'm a Linux man and trying to realize my overly ambitious programming dreams with Python, mainly because I have friends who use it and because it has l

[Tutor] XML

2007-12-20 Thread Lockhart, Luke
Hello all, Sorry if this is a double post, I had some technical problems with subscribing to this list. So I'm a very novice Python programmer. I've done stuff up to the intermediate level in Microsoft flavors of BASIC and C++, but now I'm a Linux man and trying to realize my overly ambitiou

Re: [Tutor] XML

2007-12-20 Thread Kent Johnson
Lockhart, Luke wrote: > Now, the program I'm working on would hypothetically store and read all > data as XML, and yes I'm aware of the performance drawbacks and I'm > willing to live with them. But I just can't figure out the various > libraries that Python uses to read XML, and my friend's cod

Re: [Tutor] XML data reading

2007-12-20 Thread Michael Langford
Sax is the simplest to get started with. here is a simple example. See http://docs.python.org/lib/content-handler-objects.html for more info on the methods of ContentHandler. Using some list or dict of tags you're processing such as I do in the following example will keep "tag specific code" down t

Re: [Tutor] XML data reading [slightly off topic/silly]

2007-12-20 Thread Eric Walstad
Lockhart, Luke wrote: > ...now I'm a > Linux man and trying to realize my overly ambitious programming dreams > with Python Welcome to the real world, Neo. I'm not saying that you'll be able to work with XML via DOM or SAX in Python. I'm saying that when you are ready, you won't have to. :) (

[Tutor] re-initialising shells

2007-12-20 Thread Jim Morcombe
I have had a couple of strange cases I don't understand. I am using IDLE on Windows My program imports some stuff from another file using the statement "from qwerty import *" I have changed qwerty and saved it away. I have then run my program (F5) and the program acts as if it is using an old