class GuestBook(webapp.RequestHandler):
def post(self):
self.response.out.write(
'<h2>You wrote:</h2> %s' %self.request.get('content') )
I want to pass this: %self.request.get('content') into a function. And use function return in the old place.I am python newbie. I tried.but failed. need help!
This is my function; I defined it in the same class as below.
def ept(str)
str = str + " is good."
return str
And I call it in the old place like:
ept(%self.request.get('content'))
Could anybody help me, what is wrong with my code
First of all you ought to (re-)read about string interpolation
The
%is an operator applicable to string and unicode objects, so such an object must precede its usage. So you could do%is applicable to integers as well, but that’s a different story.