My string module doesn't have maketrans or translate functions

2013-04-11 Thread Lamb
Hi all, I'm really new to python and trying to figure out the basic rule and settings of it. I'm using python 3.3 and I was trying this code in python: import string s = "string. With. Punctuation?" out = s.translate(string.maketrans("",""), string.punctuation) And I got the following error: T

Re: My string module doesn't have maketrans or translate functions

2013-04-11 Thread Lamb
Thanks! It worked! But why didn't I see functions : translate(), maketrans(), rstrip(), etc. listed when I called print(dir(string))? On Thursday, April 11, 2013 11:45:05 AM UTC-4, Chris Angelico wrote: > > > import string > > > s = "string. With. Punctuation?" > > > out = s.translate(string.m

Curried class methods?

2006-08-16 Thread Scott Lamb
I'm trying to dynamically generate class methods which have access to some state passed in at creation time. (Basically as a workaround to twisted's trial not having a way to dynamically add stuff. Plain unittest seems to have TestSuite, but the trial runner doesn't know about it.) My first attemp

Re: Curried class methods?

2006-08-17 Thread Scott Lamb
Thanks, Antoon and Carl. Just tried your solutions - both work and are much cleaner than mine. -- http://mail.python.org/mailman/listinfo/python-list

Re: why doesn't have this list a "reply-to" ?

2007-10-16 Thread Steve Lamb
lled and has the reply-to-list addon installed. Otherwise, no, Thunderbird still, years later, lacks that feature. Part of the reason why I am test driving gmane in slrn right now. :) -- Steve C. Lamb | But who decides what they dream? PGP Key: 1FC01004

Re: what is the difference between the two kinds of brackets?

2007-10-20 Thread Steve Lamb
. print "Found it!" ... Found it! >>> for loc in map: ... print "X: %s, Y: %s - %s" % (loc[0], loc[1], map[loc]) ... X: 1, Y: 1 - Something at x1, y1 The lists cannot be indexes to directories becau

Re: what is the difference between the two kinds of brackets?

2007-10-20 Thread Steve Lamb
catching that. Kids, don't late night post while waiting for the other computer to do its thing. -- Steve C. Lamb | But who decides what they dream? PGP Key: 1FC01004 | And dream I do... ---+--