from webob import Request, Response class WebApp(object): def __call__(self, environ, start_response): # capture the request coming from the browser req = Request(environ) print("**** Serving request ****") # Looks for the variable (parameter) yes_no in the request x = req.params.get('firstname') y = req.params.get('surname') print(x) print(y) if x == None or y == None or x == '' or y == '': html = """ Hi! My name is Raspberry Pi! What's your name?

Enter first name:
Enter surname:
""" else: html = 'Hello ' + x + ' ' + y + ', nice to meet you!' # create and return the response to the browser resp = Response(html) return resp(environ, start_response) application = WebApp() # main program - the web server if __name__ == '__main__': from wsgiref.simple_server import make_server port = 8080 httpd = make_server('', port, application) print('Serving HTTP on port %s...'%port) httpd.serve_forever()