> I see the continue statement as a way for me to do this, and thus
> intimately linked with exception handling.
Hi Tpc,
I think you're getting too caught up with the word "continue" and its
concept as you use it in human language, rather than what it really does
in the Python language.
I sho
hi Alan and Danny,
I think I understand what you guys are saying. I don't believe I am
ignoring the error. Ideally what I'd like is for the procedural
program to run through its steps and if it encounters an error, to log
the error and pick up where it left off and keep going. I gather you
thin
On 7/28/05, Gabriel Farrell <[EMAIL PROTECTED]> wrote:
> On Wed, Jul 27, 2005 at 07:13:49PM -0400, Don Parris wrote:
> > pg/pgdb are both part of the PyGreSQL distribution. You can choose
> > whichever you want to use, but pgdb supports the 2.0 API, whereas
> > (according to the readme) pg does no
On Thu, 28 Jul 2005 [EMAIL PROTECTED] wrote:
> ideally what I'd like is for my procedural program, when it runs through
> its steps and encounters an error, to log the error and pick up where it
> left off and keep going.
>
> so for the execution of someProcedure(), I want it to print the error
Quoting Alan G <[EMAIL PROTECTED]>:
> I found my message to Nathan, looks like I pressed the wrong
> reply button in the Outlook Express newsreader. I thought I'd
> forward it to the list since:
> a) we don't often discuss the turtle module and
Wow, I never knew this existed...
> > (The righward
Is this what you want?
>>> import string
>>> ltrs = string.lowercase
>>> [''.join([a,b]) for a in ltrs for b in ltrs]
HTH,
Alan G.
- Original Message -
From: "Chris Shenton" <[EMAIL PROTECTED]>
To:
Sent: Thursday, July 28, 2005 6:59 PM
Subject: [Tutor] range()-like function to generat
> program, when it runs through its steps and encounters an error, to
> log
> the error and pick up where it left off and keep going. According
> to this
> link, 'continue' is allowed within an except or finally:
Thats true but only if the try block is inside a loop.
Consider:
error = True
de
hi Danny, well from my previous message:
ideally what I'd like is for my procedural program, when it runs
through its steps and encounters an error, to log the error and pick
up where it left off and keep going.
so for the execution of someProcedure(), I want it to print the error
and continue ru
On 7/28/05, Kent Johnson <[EMAIL PROTECTED]> wrote:
> This will match a string of digits followed by any non-digit, is that what
> you want? If you want to restrict it to digits followed by a letter you
> should use
> r"(\d+|\d+[a-z])"
>
> Also this will match something like 123A456B, if you w
Bernard Lebel wrote:
> Hello,
>
> I'm using regular expressions to check if arguments of a function are
> valid. When I run the code below, I get an error.
>
> Basically, what the regular expression "should" expect is either an
> integer, or an integer followed by a letter (string). I convert the
Hello,
I'm using regular expressions to check if arguments of a function are
valid. When I run the code below, I get an error.
Basically, what the regular expression "should" expect is either an
integer, or an integer followed by a letter (string). I convert the
tested argument to a string to mak
On Thu, 2005-07-28 at 13:59 -0400, Chris Shenton wrote:
> I'm looking for a range()-like function which could generate a list of
> character-oriented tokens, like to iterate over all two-character
> sequences like:
>
> pseudorange('aa', 'zz') would generate:
> aa, ab, ..., az, ba, ..., za, ...,
I'm looking for a range()-like function which could generate a list of
character-oriented tokens, like to iterate over all two-character
sequences like:
pseudorange('aa', 'zz') would generate:
aa, ab, ..., az, ba, ..., za, ..., zz
range() doesn't do character iteration, and I'm sure I could wr
Alan G wrote:
>>> Now I want that another class, call it B, inherits all
>>> behaviours/attributes except for the attribute blank, that now I want
>>> to be False.
>
>
>> class B(A):
>> def __init__(self, blank=True, editable=True, name='foo'):
>>A.__init__(self, blank, editable, name)
>
>
On Thu, 28 Jul 2005 [EMAIL PROTECTED] wrote:
> import testTryCatch
> try:
> testTryCatch.someProcedure()
> except:
> print "encountered error"
> continue
>
> but I get the following error:
>
> SyntaxError: 'continue' not properl
>> Now I want that another class, call it B, inherits all
>> behaviours/attributes except for the attribute blank, that now I
>> want
>> to be False.
> class B(A):
> def __init__(self, blank=True, editable=True, name='foo'):
>A.__init__(self, blank, editable, name)
except that instead of pa
hey guys, so I've been trying to get my head around the try except
statement in Python, and ideally what I'd like is for my procedural
program, when it runs through its steps and encounters an error, to log
the error and pick up where it left off and keep going. According to this
link, 'continue'
I found my message to Nathan, looks like I pressed the wrong
reply button in the Outlook Express newsreader. I thought I'd
forward it to the list since:
a) we don't often discuss the turtle module and
b) I ask a question at the end that I'd like an answer to! :-)
Alan G.
- Original Message
On Wed, 27 Jul 2005, Pujo Aji wrote:
> I write a program which launch pylab from windows GUI (using wxpython).
> I found some problem here.
>
> If I use the default backends program in matplotlibrc which is TkAgg
> I have this result:
> 1. I click button the plot is showed
> 2. I close the plot
David Driver wrote:
> If I
> create a dictionary with the same keys, will it str the same way?
This behaviour is not guaranteed and I wouldn't depend on it. It can break if
any other operations have happened on the dict; for example
>>> d=dict(a=1,b=2,c=23)
>>> str(d)
"{'a': 1, 'c': 23, 'b': 2
On Wed, Jul 27, 2005 at 07:13:49PM -0400, Don Parris wrote:
> pg/pgdb are both part of the PyGreSQL distribution. You can choose
> whichever you want to use, but pgdb supports the 2.0 API, whereas
> (according to the readme) pg does not. I will try pg when I get back
> to my box tonight, but woul
The following code:
print str(dict(a=1,b=2,c=-1))
print str(dict(a=1,c=-1,b=2))
print str(dict(c=-1,a=1,b=2))
print str(dict(b=2,a=1,c=-1))
print str(dict(b=2,c=-1,a=1))
print
print str(dict(a=1,b=2,c=23))
print str(dict(a=1,c=23,b=2))
print str(dict(c=23,a=1,b=2))
print str(dict(b=2,a=1,c=23))
pr
[cut]
>
> Yes, that is the more modern way to do it for new-style classes. In the
> original example, class A does not inherit from object so I used the older
> style.
>
Thanks guys for your answers, it's clear (even if I wouldn't be able
to figure it out by my own).
About old style/new style
Cedric BRINER wrote:
>>>However, is it possible to achieve this without rewrite the whole
>>>__init__ method, but just overriding parts of it?
>>
>>The usual way to do this is to forward to the __init__() method of the
>>superclass for the common part. In your case you are just specializing the
>
> > However, is it possible to achieve this without rewrite the whole
> > __init__ method, but just overriding parts of it?
>
> The usual way to do this is to forward to the __init__() method of the
> superclass for the common part. In your case you are just specializing the
> default arguments
Negroup - wrote:
> I have this class:
>
class A:
>
> ... def __init__(self, blank=False, editable=True, name='foo'):
> ... self.blank = blank
> ... self.editable = editable
> ... self.name = name
> ...
>
a = A()
a.blank, a.editable, a.name
>
>
hi,
1)OB
I'm learning for almost a year and half python. this is my first language. I'm
fine with classes, definition... But now I'm trying to understand better things
as:
static method
class method
and the use of metaclass.
Does some one of you knows about a compilations of small snippets showi
I have this class:
>>> class A:
... def __init__(self, blank=False, editable=True, name='foo'):
... self.blank = blank
... self.editable = editable
... self.name = name
...
>>> a = A()
>>> a.blank, a.editable, a.name
(False, True, 'foo')
All as expected.
No
Danny and John,
Thanks for the pointers. As I am leaving the project where I need to do this tomorrow, I don't think I will have time to do this, but thanks for the help anyway.
DavidDanny Yoo <[EMAIL PROTECTED]> wrote:
On Wed, 27 Jul 2005, David Holland wrote:> I know how to open files in pyt
[key, info] you mean...
Oops. That'd be the one.
Looks
good to me other than the name :-) I would call it toDict() or
toNestedDict() maybe; IMO a function named isXXX should just return
True or False.
Yah, it started off as a boolean return, and then I decided to go for the big one, so to speak,
Liam Clarke gmail.com> writes:
> Are there any other pitfalls with recursion I need to watch for?
Not just infinite recursion, but recursion that exceeds the maximum recursion
depth (1000 on my system). You can add a counter parameter to your recursive
function and stop recursing if the functio
Liam Clarke wrote:
> Just playing with my first recursive function, and just wanted your
> experienced opinions on whether it's likely to blow up in my face,
> as it all seems to work fine out of the gates, and that makes me a
> little paranoid.
>
> For a given list -
>
> x = [ ['tag', 'CYP'],
Hi all,
Spen too much time coding in VBA, so I'm now paranoid about any code I write.
Just playing with my first recursive function, and just wanted your
experienced opinions on whether it's likely to blow up in my face,
as it all seems to work fine out of the gates, and that makes me a little pa
Nathan,
I tried to send you a reply about using the 'turtle' module to do
your graphics, did you receive it? I sent it from the gane news
archive server and its not there and I haven't seen it on the group
so I'm wondering if it ever actually went anywhere?...
Alan G.
- Original Message
34 matches
Mail list logo