Re: [Tutor] Is there a convenient table of Python 3.4 exceptions?

2014-10-23 Thread Ben Finney
(Danny, please preserve attribution lines for the quoted text.) Danny Yoo writes: > > Of course I can force an error to occur in the interpreter and see > > what comes up for each type of error I wish to catch. Is there such > > a table or list? > > […] > Usually the documentation should say wha

Re: [Tutor] Is there a convenient table of Python 3.4 exceptions?

2014-10-23 Thread Danny Yoo
> I have so far been unable to find a list of these class/subclass names. Of > course I can force an error to occur in the interpreter and see what comes > up for each type of error I wish to catch. Is there such a table or list? > Hi Bob, You can find the ones used in the Standard Library here:

Re: [Tutor] Is there a convenient table of Python 3.4 exceptions?

2014-10-23 Thread Ben Finney
boB Stepp writes: > My current understanding is that exception1, ... , exceptionN should > match one of Python's exception classes or subclasses in order to > perform a match and execute the corresponding exception suite. Correct. Bear in mind that “… or subclasses” covers user-defined exception

[Tutor] Is there a convenient table of Python 3.4 exceptions?

2014-10-23 Thread boB Stepp
I am reading a brief intro to exception handling in Mark Summerfield's "Programming in Python 3, 2nd ed." He gives the basic syntax as: try: try_suite except exception1 as variable1: exception_suite1 ... except exceptionN as variableN: exception_suiteN My current understanding is that

Re: [Tutor] yet another misunderstanding on my part

2014-10-23 Thread Dave Angel
Dave Angel Wrote in message: > "Clayton Kirkwood" Wrote in message: > > > Second question, why can't a numeric index be >> used to make assignment to a specific location like a[1] = "some value"? If >> the mechanism is to use a.index(1,"some value"), > > The index() method does not change th

Re: [Tutor] yet another misunderstanding on my part

2014-10-23 Thread Alan Gauld
On 22/10/14 19:48, Clayton Kirkwood wrote: Regarding the index out of range, I know what it meant, I was just kind of surprised that Python didn't automatically create the node and stuff a value in. But what should Python do in this case aNewList[100] = 42 Should Python create a 1 millio

Re: [Tutor] Question on a select statement with ODBC

2014-10-23 Thread Peter Otten
Al Bull wrote: > Quick question then... > > Does this do the trick? I may have misunderstood your original question; do you want to delete records from the database or from the Python list? Your code below will do the latter, once you have fixed the bugs. > Currentrecord = 1 > > While curre

Re: [Tutor] yet another misunderstanding on my part

2014-10-23 Thread Dave Angel
"Clayton Kirkwood" Wrote in message: (Somehow, your email program seems to be using the exclamation point to identify quoted lines, instead of the standard greater-than symbol. Is that something you can correct, prrhaps using "settings"?) > > > !-Original Message- > !From: Tuto

Re: [Tutor] Passing Data to .DLL

2014-10-23 Thread Wilson, Pete
No worries, if I could spell I would have been a Lawyer. Pete > -Original Message- > From: eryksun [mailto:eryk...@gmail.com] > Sent: Wednesday, October 22, 2014 5:36 PM > To: Wilson, Pete > Cc: tutor@python.org > Subject: Re: [Tutor] Passing Data to .DLL > > On Wed, Oct 22, 2014 at 6:05

Re: [Tutor] Passing Data to .DLL

2014-10-23 Thread Wilson, Pete
It's working! I don't understand the line rx_buf = (c_uint8 * rx_buf_size).from_buffer_copy(string_buf) or where .from_buffer_copy() came from but it works... I promise I will not knowingly pass Python strings to C. Thanks. > -Original Message- > From: eryksun [mailto:eryk...@gmail.com

Re: [Tutor] yet another misunderstanding on my part

2014-10-23 Thread Clayton Kirkwood
!-Original Message- !From: Tutor [mailto:tutor-bounces+crk=godblessthe...@python.org] On !Behalf Of Steven D'Aprano !Sent: Wednesday, October 22, 2014 4:03 AM !To: tutor@python.org !Subject: Re: [Tutor] yet another misunderstanding on my part ! !On Tue, Oct 21, 2014 at 09:54:49PM -0700, C

Re: [Tutor] Question on a select statement with ODBC

2014-10-23 Thread Al Bull
-Original Message- From: Tutor [mailto:tutor-bounces+a.bull=pubdmgroup@python.org] On Behalf Of Alan Gauld Sent: Wednesday, October 22, 2014 12:13 PM To: tutor@python.org Subject: Re: [Tutor] Question on a select statement with ODBC On 22/10/14 16:06, Al Bull wrote: > I don't think I