euglug.org

euglug.org

Latest posts

  • [Python] Speed up this code?

    Bob MillerThu May 25 21:55:28 PDT 2006 Martin Kelly wrote: > What is the purpose of sets? I didn’t know about them yet. A set is an unordered…

  • [Python] Speed up this code?

    Martin KellyThu May 25 19:34:16 PDT 2006 Thanks all, it worked! Quite zippy now :). What is the purpose of sets? I didn’t know about them yet. It…

  • [Python] Speed up this code?

    Martin KellyThu May 25 19:30:02 PDT 2006 Nope, I tried that and no effect (at least noticeably). Mike Casaday wrote: > Not sure if it’s faster, but try…

  • [Python] Speed up this code?

    Bob MillerThu May 25 18:38:53 PDT 2006 Martin Kelly wrote: > def rmlist(original, deletions): > return [i for i in original if i not in deletions] Is deletions…

  • [Python] Speed up this code?

    Mike CasadayThu May 25 18:15:43 PDT 2006 Not sure if it’s faster, but try this: def rmlist(original, deletions): return filter(lambda i: i not in deletions, original) On May…

  • [Python] Speed up this code?

    Martin KellyThu May 25 18:10:12 PDT 2006 I’m creating a program to calculate all primes numbers in a range of 0 to n, where n is whatever the…

  • [Python] shortcut?

    Bob MillerMon May 22 19:14:06 PDT 2006 Rob Hudson wrote: > Is there a Python shortcut for the following? > > if d.has_key(k): > d[k].append(v) > else: >…

  • [Python] web.py

    Rob HudsonMon May 22 10:18:57 PDT 2006 Has anyone seen web.py? I saw a reference to it. It seems like a *very* light Python framework. It looks kind…

  • [Python] shortcut?

    cmeyers at guardnet.comMon May 22 09:55:43 PDT 2006 Oops This works for counters and stuff but as Horst points out, append is a modification in place function. Sorry…