Python Web framework: web.py

Source: Internet
Author: User

web.py is a Python web framework that is simple and powerful. web.py is open, no matter what use is not limited

of the system.

web.py Installation:

Pip Install web.py

Let's start with our first instance of hello.py:

# _*_ Coding:utf-8 _*_import weburls = ("/.*", "Hello")        # Specifies that any URL is pointing to the Hello class app = Web.application (URLs, Globals ()) # bound U rl# definition class Hello:    def GET (self): #函数名为该函数的请求方式        return ' Hello, sary ' #GET回应if __name__ = = "__main__":    App.run ()

Then save it as hello.py and run it

Python hello.py

You can see the output:http://0.0.0.0:8080/

Then the browser accesses: http://localhost:8080 can see

Hello, Sary.

The first Web program we wrote in Python was built.

Python Web framework: web.py

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.