On Mar 12, 5:10 am, Frank Millman <[EMAIL PROTECTED]> wrote:
> gargonx wrote:
> > Say i have the two methods:
>
> > def ReturnMethod(request, x):
> > if request is True:
> > return x
> > else: print "No String for you...False!&
On Mar 12, 4:45 am, Adonis Vargas <[EMAIL PROTECTED]
bellsouth.net> wrote:
> gargonx wrote:
> > Say i have the two methods:
>
> > def ReturnMethod(request, x):
> > if request is True:
> > return x
> > else: print "No String
Say i have the two methods:
def ReturnMethod(request, x):
if request is True:
return x
else: print "No String for you...False!"
def SendMethod(request):
xstring = "Some text"
ReturnMethod(request, xstring)
SendMethod(True)
Why does ReturnMethod not return the string
Even if i put it in exactly the way you did:
>>> import re
>>> charmatcher = re.compile(r' [A-Z] [\d]?')
>>>
>>> ext = dict(D="V1", O="M1", G="S1")
>>> std = dict(S="H")
>>>
>>> decode_replacements ={}
>>> decode_replacements.update([(std[key], key) for key in std])
Traceback (most recent call las
I think there's a problem with the code:
py> decode_replacements.update([(std[key], key) for key in std])
py> decode_replacements.update([(ext[key], key) for key in ext])
when i run this i get an error:
AttributeError: keys
I can't get that figured out
--
http://mail.python.org/mailman/list
let's take the word "dogs"
ext = dict("D":"V1", "O":"M1", "G":"S1")
std = dict("S":"H")
encode("DOGS") # proc()
we'll get: "V1M1S1H"
let's say i want to do just the opposite
word: "V1M1S1H"
decode("V1M1S1H")
#how do i decode "V1" to "D", how do i keep the "V1" together?
and get: "DOGS
Well that seems to work like a champion, but my prob then would be; how
do i get the double character values of ext to turn back to the single
character keys. The reversed (decode if you will). Thanks a lot Steve
this has been a great learning!
--
http://mail.python.org/mailman/listinfo/python-li
yes the items in std are always single to single, and ext single to
double. basicly the ext are refernce to the std itmes. the second
character in ext is a number depending on how far it is from the item
in std. this is just a simple encoding program.
--
http://mail.python.org/mailman/listinfo/py
Thanks that works very well
--
http://mail.python.org/mailman/listinfo/python-list
This works much better, aside from the fact that it does'nt work for
the std dictionary. the letters used from here stay the same. that
dictionary looks like this:
std = {
"A":"Z",
"Z":"A",
"B":"Y",
"Y":"B",
"C":"X",
"X":"C",
"E":"V",
"V":"E",
"H":"S",
"S":"
would anyone like to help to fugure out this problem i'm having here's
a portion of my code:
"""
I have three dictionaries along with this(you can probally spot what
they are), but just in case here are some testers:
"""
std = {
"b":"bo"
}
ext = {
"aa":"i"
}
punc = {
",":"!"
11 matches
Mail list logo