Sunday, 10 July 2011 : Installation and working is a simple web frame work that is written in python for the development of python related web applications.The main feature about web .py is that it is very simple and efficient compared to others


  • Download from the below link.Then extract and copy it into to any directory that your application resides or make it accessible to all applications.
  • Type "cd" in Terminal to "change the directory "where you copied, If you list the contents you  can see a file inside it. To install the file type the below command.
                            python install.
  • when you found any permission denied messages when installing in unix like systems,switch to root user and then try the below command.
                            sudo python install


    when you installed it properly you can try it by creating some simple webpages.Open any of your favorite  editor and  creating a file named "" as shown below.

import web

urls = (

  '/', 'hello')

app = web.application(urls, globals())

class hello:

    def GET(self):

        return 'Hello, web!'

if __name__ == "__main__":

Here  first you need to import the module to use the tools provided by i.e the first line actually refers.

In the second line we are actually mapping the web address(URL) i.e "" to a python class    named "hello".

Inside the class you can see a function named  "GET()".This  function "GET()" is actually displays the content  in your browser when your browser opens a web page.Here it will display the string "Hello,web" .

In the third line we are creating an instance .It will handle the all duties like handling the browser request and   serving the desired pages.

The last line will start the web application to handle your requests.

Save the above file and run by using the command python

when you run the file,the output will be the address of your website ,by default it is (http://localhost:8080/).    when you copy it and paste it in your browser search bar you will get the resultant web page.

No comments:

Post a Comment