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
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
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
Thanks, Antoon and Carl. Just tried your solutions - both work and are
much cleaner than mine.
--
http://mail.python.org/mailman/listinfo/python-list
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
. 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
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...
---+--