hi andi,

the num and num2 arguments for the add() method are the input taken by
the bot, if the user types in "?add num num2".  (i ripped the command
syntax  used by the grauni...@appspot.com bot.  actually...now that
you mention it, the only thing i could think of that would make it
respond in that fashion would be that the user clicks the 'Done'
button on the blip or presses Shift-Enter to submit the blip, which i
guess would create a newline.  is there a way to suppress that end of
line?



On Fri, Aug 7, 2009 at 2:19 PM, Andi
Albrecht<albrecht.a...@googlemail.com> wrote:
>
> On Fri, Aug 7, 2009 at 12:46 AM, Jason
> Salas<digitalpontificat...@gmail.com> wrote:
>>
>> now that i'm in the office and have my code handy, here's the routine i'm 
>> using:
>>
>> def add(num,num2):
>>        sum = str(int(num) + int(num2))
>>        return 'The sum of %s and %s is: %s' % (num,num2,sum)
>
> Given this code example, I think the only answer is that num2 is the
> string "6\n".Where does num2 come from?
>
>>
>> the output, as printed within a new blip and within my GAE logs, is:
>>
>> "The sum of 5 and 6\n is: 11"
>>
>> thoughts?
>>
>> On Fri, Aug 7, 2009 at 6:39 AM, Jason
>> Salas<digitalpontificat...@gmail.com> wrote:
>>> I have this problem, too...I'm working in Python and doing string
>>> interpolation and the outputted content that gets printed in a new
>>> blip for some reason has a newline. I can't figure out why.
>>>
>>> On 8/6/09, jamz2010 <itjamesspeak...@googlemail.com> wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I am having some issues with reading the last blip from my wavelet in
>>>> my robot. I have used the line
>>>>
>>>> String sLastBlip = e.getBlip().getDocument().getText();
>>>>
>>>> to get me the last blip that was added to the wave but it appears to
>>>> be automatically adding a new line to the end of the wave. I have
>>>> tried using
>>>>
>>>> sLastBlip = sLastBlip.replaceAll("\n", "n").replaceAll("\r", "r");
>>>>
>>>> to remove all the new line characters from the string but this doesn't
>>>> appear to work. I can use
>>>>
>>>> sLastBlip = sLastBlip.substring(0, sLastBlip.length()-1);
>>>>
>>>> to remove the last character from the string but if the user puts
>>>> there own new line in it wont work. Does anyone know what character
>>>> google wave uses for a new line?
>>>>
>>>> Thanks
>>>>
>>>> James
>>>>
>>>> >>
>>>>
>>>
>>
>> >
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to