Re: [Tutor] Eng to Leet Speek

2009-07-27 Thread bob gailer
Kent Johnson wrote: On Mon, Jul 27, 2009 at 4:02 PM, Alan Gauld wrote: You might want to investigate the maketrans and translate functions in the string module. The seem to be quite similar in intent to what you are trying to do? No, those will only do 1-for-1 character substitutions

Re: [Tutor] Eng to Leet Speek

2009-07-27 Thread Kent Johnson
On Mon, Jul 27, 2009 at 4:02 PM, Alan Gauld wrote: > You might want to investigate the maketrans and translate functions in the > string module. > > The seem to be quite similar in intent to what you are trying to do? No, those will only do 1-for-1 character substitutions. Kent _

Re: [Tutor] Eng to Leet Speek

2009-07-27 Thread Alan Gauld
"Chris Castillo" wrote and I am trying to turn it into english with the following code: def eng2leet(astring): astring = astring.replace("4","a") astring = astring.replace("8","b") astring = astring.replace("[","c") astring = astring.replace("|)","d") You might want to investig

Re: [Tutor] Eng to Leet Speek

2009-07-27 Thread Chris Castillo
On Mon, Jul 27, 2009 at 2:08 PM, Dave Angel wrote: > Chris Castillo wrote: > >> so I have a string: >> >> 1 4|-| 50 |_33+. I love [#ick3n 4nd ch3353. Don't you love +|_|2|\e7 >> \/\/1+# the |#a|-|i|_7? >> >> >> and I am trying to turn it into english with the following code: >> >> fileIn = open

Re: [Tutor] Eng to Leet Speek

2009-07-27 Thread Dave Angel
Chris Castillo wrote: so I have a string: 1 4|-| 50 |_33+. I love [#ick3n 4nd ch3353. Don't you love +|_|2|\e7 \/\/1+# the |#a|-|i|_7? and I am trying to turn it into english with the following code: fileIn = open("encrypted.txt", "r").read() def eng2leet(astring): astring = astring.re

Re: [Tutor] Eng to Leet Speek

2009-07-27 Thread Chris Castillo
On Mon, Jul 27, 2009 at 1:38 PM, J Sisson wrote: > You need a deterministic algorithm for conversion. It's impossible > (without analyzing the context of the word) to translate "|_|#" (it's either > "lf" or "uh", but which?). > > > > > On Mon, Jul 27, 2009 at 1:13 PM, Chris Castillo wrote: > >>

Re: [Tutor] Eng to Leet Speek

2009-07-27 Thread J Sisson
You need a deterministic algorithm for conversion. It's impossible (without analyzing the context of the word) to translate "|_|#" (it's either "lf" or "uh", but which?). On Mon, Jul 27, 2009 at 1:13 PM, Chris Castillo wrote: > so I have a string: > > 1 4|-| 50 |_33+. I love [#ick3n 4nd ch3

[Tutor] Eng to Leet Speek

2009-07-27 Thread Chris Castillo
so I have a string: 1 4|-| 50 |_33+. I love [#ick3n 4nd ch3353. Don't you love +|_|2|\e7 \/\/1+# the |#a|-|i|_7? and I am trying to turn it into english with the following code: fileIn = open("encrypted.txt", "r").read() def eng2leet(astring): astring = astring.replace("4","a") astri