Re: [Tutor] Using Regex to produce text

2010-04-27 Thread Luke Paireepinart
On Wed, Apr 28, 2010 at 1:27 AM, wrote: > Dear All, > > Quick question: > > Is there an way of using the regex patterns to produce text, instead of > matching it? > > E.g.: > pat = re.compile("ab?d") > pat.getListofPossibleText() > There's no end to the length of many patterns so this would be

[Tutor] Using Regex to produce text

2010-04-27 Thread mhw
Dear All, Quick question: Is there an way of using the regex patterns to produce text, instead of matching it? E.g.: pat = re.compile("ab?d") pat.getListofPossibleText() Thanks, Matt Sent from my BlackBerry® wireless device ___ Tutor maillist -

Re: [Tutor] (no subject)

2010-04-27 Thread Luke Paireepinart
On Tue, Apr 27, 2010 at 10:12 PM, Marco Rompré wrote: > Oups my posting was too big!!! > > On Tue, Apr 27, 2010 at 11:04 PM, Marco Rompré > wrote: >> >> Why is none of my items button works In this, I have two files and in >> my second file I imported all the function of the first one >> >> H

Re: [Tutor] How can I display my float as a string???

2010-04-27 Thread Lie Ryan
On 04/28/10 12:35, Marco Rompré wrote: > Here is my code, I need to display my float value as a string. > > item.set_prix str(float(prix)) print prix ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.pyt

Re: [Tutor] (no subject)

2010-04-27 Thread Marco Rompré
Oups my posting was too big!!! On Tue, Apr 27, 2010 at 11:04 PM, Marco Rompré wrote: > Why is none of my items button works In this, I have two files and in > my second file I imported all the function of the first one > > Here is my codes and my error code for the two files please help me:

[Tutor] How can I display my float as a string???

2010-04-27 Thread Marco Rompré
Here is my code, I need to display my float value as a string. item.set_prix str(float(prix)) Thank You -- Marc-O. Rompré ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tut

Re: [Tutor] Modify inherited methods

2010-04-27 Thread Alan Gauld
"Steven D'Aprano" wrote On Wed, 28 Apr 2010 07:24:48 am C M Caine wrote: I'm writing a class that inherits the inbuilt dict class and want some of my own code to run at initialisation, on the other hand, I still want the original dict.__init__ function to run. ... This is the general techni

Re: [Tutor] Modify inherited methods

2010-04-27 Thread Steven D'Aprano
On Wed, 28 Apr 2010 08:08:12 am Steven D'Aprano wrote: > Some people argue that you must call dict.__init__ even though it > doesn't do anything. Their reasoning is, some day its behaviour might > change, and if you don't call it in your subclass, then your class > may break. This is true, as far

Re: [Tutor] Modify inherited methods

2010-04-27 Thread Steven D'Aprano
On Wed, 28 Apr 2010 07:24:48 am C M Caine wrote: > I'm writing a class that inherits the inbuilt dict class and want > some of my own code to run at initialisation, on the other hand, I > still want the original dict.__init__ function to run. Can I ask the > class to run the original __init__ and t

[Tutor] Modify inherited methods

2010-04-27 Thread C M Caine
I'm writing a class that inherits the inbuilt dict class and want some of my own code to run at initialisation, on the other hand, I still want the original dict.__init__ function to run. Can I ask the class to run the original __init__ and then my own function at initialisation automatically? If s

Re: [Tutor] For loop breaking string methods

2010-04-27 Thread bob gailer
On 4/26/2010 10:19 PM, Dave Angel wrote: Note also that if you insert or delete from the list while you're looping, you can get undefined results. The results are not undefined. They m,ight be unexpected, but that is due to an invalid assumption. The behavior is explained in section 7.3

Re: [Tutor] For loop breaking string methods

2010-04-27 Thread Lie Ryan
On 04/27/10 12:19, Dave Angel wrote: > Note also that if you insert or delete from the list while you're > looping, you can get undefined results. That's one reason it's common > to build a new loop, and just assign it back when done. Example would > be the list comprehension you showed earlier.

[Tutor] Multipane windows using curses

2010-04-27 Thread mhw
Dear All, I am looking for some advice about a design decision. I want to write a curses-based editor (for OWL ontologies). This should then be usable via ssh, etc. Ontology files may be large, and quite complex. Current editors (e.g. Protege) have multiple tabs to cope with this. The simplest