Re: string.replace doesn't removes :

2013-02-14 Thread jmfauth
On 13 fév, 21:24, 8 Dihedral dihedral88...@googlemail.com wrote: Rick Johnson於 2013年2月14日星期四UTC+8上午12時34分11秒寫道: On Wednesday, February 13, 2013 1:10:14 AM UTC-6, jmfauth wrote: d = {ord('a'): 'A', ord('b'): '2', ord('c'): 'C'} 'abcdefgabc'.translate(d) 'A2CdefgA2C'

Re: string.replace doesn't removes :

2013-02-13 Thread Rick Johnson
On Wednesday, February 13, 2013 1:10:14 AM UTC-6, jmfauth wrote: d = {ord('a'): 'A', ord('b'): '2', ord('c'): 'C'} 'abcdefgabc'.translate(d) 'A2CdefgA2C' def jmTranslate(s, table): ... table = {ord(k):table[k] for k in table} ... return s.translate(table) ... d = {'a':

Re: string.replace doesn't removes :

2013-02-13 Thread Mark Lawrence
On 13/02/2013 16:34, Rick Johnson wrote: On Wednesday, February 13, 2013 1:10:14 AM UTC-6, jmfauth wrote: d = {ord('a'): 'A', ord('b'): '2', ord('c'): 'C'} 'abcdefgabc'.translate(d) 'A2CdefgA2C' def jmTranslate(s, table): ... table = {ord(k):table[k] for k in table} ... return

Re: string.replace doesn't removes :

2013-02-13 Thread Walter Hurry
On Wed, 13 Feb 2013 16:55:36 +, Mark Lawrence wrote: On 13/02/2013 16:34, Rick Johnson wrote: On Wednesday, February 13, 2013 1:10:14 AM UTC-6, jmfauth wrote: d = {ord('a'): 'A', ord('b'): '2', ord('c'): 'C'} 'abcdefgabc'.translate(d) 'A2CdefgA2C' def jmTranslate(s, table): ...

Re: string.replace doesn't removes :

2013-02-13 Thread 88888 Dihedral
Rick Johnson於 2013年2月14日星期四UTC+8上午12時34分11秒寫道: On Wednesday, February 13, 2013 1:10:14 AM UTC-6, jmfauth wrote: d = {ord('a'): 'A', ord('b'): '2', ord('c'): 'C'} 'abcdefgabc'.translate(d) 'A2CdefgA2C' def jmTranslate(s, table): ... table = {ord(k):table[k]

Re: string.replace doesn't removes :

2013-02-12 Thread vduncan80
On Sunday, February 10, 2013 4:36:53 AM UTC-6, Johannes Bauer wrote: On 09.02.2013 12:04, Joshua Robinson wrote: Hi *Monte-Pythons*, x = this is a simple : text: that has colon s = x.replace(string.punctuation, ); OR s = x.replace(string.punctuation, ); print x # 'this

Re: string.replace doesn't removes :

2013-02-12 Thread Rick Johnson
On Saturday, February 9, 2013 5:04:18 AM UTC-6, Joshua Robinson wrote: Hi Monte-Pythons, x = this is a simple : text: that has colon s = x.replace(string.punctuation, ); OR s = x.replace(string.punctuation, ); print x # 'this is a simple : text: that has colon' # The colon is still

Re: string.replace doesn't removes :

2013-02-12 Thread Rick Johnson
On Tuesday, February 12, 2013 10:44:09 PM UTC-6, Rick Johnson wrote: REFERENCES: [1]: Should string.replace handle list, tuple and dict arguments in addition to strings?

Re: string.replace doesn't removes :

2013-02-12 Thread jmfauth
On 13 fév, 06:26, Rick Johnson rantingrickjohn...@gmail.com wrote: On Tuesday, February 12, 2013 10:44:09 PM UTC-6, Rick Johnson wrote:  REFERENCES: [1]: Should

Re: string.replace doesn't removes :

2013-02-10 Thread Johannes Bauer
On 09.02.2013 12:04, Joshua Robinson wrote: Hi *Monte-Pythons*, x = this is a simple : text: that has colon s = x.replace(string.punctuation, ); OR s = x.replace(string.punctuation, ); print x # 'this is a simple : text: that has colon' # The colon is still in the text Is this a

string.replace doesn't removes :

2013-02-09 Thread Joshua Robinson
Hi *Monte-Pythons*, x = this is a simple : text: that has colon s = x.replace(string.punctuation, ); OR s = x.replace(string.punctuation, ); print x # 'this is a simple : text: that has colon' # The colon is still in the text Is this a bug or am I doing something wrong ? Py.Version: 2.7

Re: string.replace doesn't removes :

2013-02-09 Thread Chris Angelico
On Sat, Feb 9, 2013 at 10:04 PM, Joshua Robinson shooki.robin...@gmail.com wrote: Hi Monte-Pythons, x = this is a simple : text: that has colon s = x.replace(string.punctuation, ); OR s = x.replace(string.punctuation, ); print x # 'this is a simple : text: that has colon' # The colon is