Форум сайта python.su
class ApiHandler(object): def __call__(self, environ, start_response): req = Request(environ) meth_name = req.path[1:] if not meth_name: meth_name = "main_page" try: if hasattr(self, meth_name): resp = Response(getattr(self, meth_name)(req)) else: resp = exc.HTTPBadRequest('No such action %r' % req.path) except exc.HTTPException, e: resp = e return resp(environ, start_response) def main_page(self, req): resp = """ <html><head><title>SOLVING problem: %(b)s = %(a)s + 1</title></head> <body> <table width=100%% height=100%% style="margin:0 auto 0 auto; background: url(<!тут главный вопрос!>) no-repeat center center"><tr> <td width=105></td> <td align="center"> <form action="show" method="GET"> <input type="submit" name="b" value="ENTER"> </form></td><td width=90></td> </tr> <tr><td height=90></td></tr> <tr><td></td></tr> </table> </body></html> """ return resp
Офлайн
"../images/img1.png"
Офлайн