Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Choose Your Own Pyventure/Webpy Hello World

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

''' A simple Hello,World in web.py!''' # make sure the 'web' dir from web.py is in # the same directory import web # the url mapper, maps /(anything!) to the # 'hello' class. urls = ( '/(.*)', 'hello' ) # create the actual application app = web.application(urls, globals()) # a class for handling url requests # to handle requests, the class must have a # GET method that returns text class hello: def GET(self, name): if not name: name = 'world' return 'Hello, ' + name + '!' # just include these 2 lines, which will seem magical for # now, don't worry about it! if __name__ == "__main__": app.run()