I want help on how I would get a variable in a class function sent to another module in python. For example:
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.render('main.html')
def post(self):
event = self.get_argument('event')
print event
return event
How can I use the event variable in another python module?
Thanks
make it
self.event…the reason for this is that event only exists in the scope of post method as it is…
it is created when you call post and destroyed when you exit post
this page may help explain scope and variable lifetimes for you
http://www.saltycrane.com/blog/2008/01/python-variable-scope-notes/
Module 1
Module 2