On Sep 6, 3:44 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> Chris Johnson <[EMAIL PROTECTED]> writes:
> > a = [lambda: i for i in range(10)]
> > print [f() for f in a]
> > results in: [9, 9, 9, 9, 9, 9, 9, 9, 9, 9]
> > rather than the hoped for: [0, 1
What I want to do is build an array of lambda functions, like so:
a = [lambda: i for i in range(10)]
(This is just a demonstrative dummy array. I don't need better ways to
achieve the above functionality.)
print [f() for f in a]
results in: [9, 9, 9, 9, 9, 9, 9, 9, 9, 9]
rather than the hoped f
Thomas Ploch wrote:
> Fredrik Lundh wrote:
> > Nick Craig-Wood wrote:
> >
> >> A regular expression matcher uses a state machine to match strings.
> >
> > unless it's the kind of regular expression matcher that doesn't use a
> > state machine, like the one in Python.
> >
> >
> >
>
> How is the ma
BJörn Lindqvist wrote:
> With regexps you can search for strings matching it. For example,
> given the regexp: "foobar\d\d\d". "foobar123" would match. I want to
> do the reverse, from a regexp generate all strings that could match
> it.
>
> The regexp: "[A-Z]{3}\d{3}" should generate the strings
spawn wrote:
> but I've been struggling with this for far too long and I'm about to
> start beating my head against the wall.
>
> My assignment seemed simple: create a program that will cacluate the
> running total of user inputs until it hits 100. At 100 it should stop.
> That's not the problem
Hendrik van Rooyen wrote:
> Hi there,
>
> I can write:
>
> s = 'some string'
> then print s[1] will be the string 'o'
>
> and a while later I can write:
>
> s = 'other some string'
> then print s[1] will be the string 't'
>
> and then:
>
> s = [1,2,3,4]
> then print s[1] will be the number 2
>
> a
Martin Höfling wrote:
> Hi there,
>
> is it possible to put the methods of a class in different files? I just
> want to order them and try to keep the files small.
>
> Regards
> Martin
I ran across pyp the other day. It may be what you're wanting.
http://www.freenet.org.nz/python/pyp/
--
Good morning.
I have recently begun a project using PyGTK, and part of my planned
interface has a gtk.TreeView showing a portion of the filesystem. Now,
rather than load the entire FS structure into the tree right from the
beginning, I made a lazy tree by adding blank children to rows
representing