"Python" "Bobo"

Source: Internet
Author: User

My Mac Environment, python3.5

1. Installation bobo: >>> PIP3 Install Bobo

2. Configure Environment variables:

$: VI ~/.bash_profile

Add a line: Alias bobo = "Address" (I just install finished Bobo, in the bin of python3.5 more Bobo boot file, this address is the address of the boot file)

Exit VI

$: Source ~/.bash_profile

3. Create a method using Bobo in a py file, the contents of the file

Import Bobo
@bobo. Query ('/')
def hello (person):
Return ' Hello%s '% person

4. $: bobo-f py file address/py file name.

This launches the Bobo Development server

5. Enter the browser, enter: localhost:8080

6. The browser displays "Missing form variable Person"

7. Open a different terminal input curl-i http://localhost:8080/, print the following

http/1.0 403 Forbidden

Date:fri, Oct 06:20:35 GMT

server:wsgiserver/0.2 cpython/3.5.3

content-type:text/html; Charset=utf-8

content-length:103

<body>missing form Variable person</body>

8 Open an additional terminal, enter: Curl-i http://localhost:8080/?person=jim

Terminal printing:

http/1.0 OK

Date:fri, Oct 06:21:14 GMT

server:wsgiserver/0.2 cpython/3.5.3

content-type:text/html; Charset=utf-8

Content-length:9

Browser input localhost:8080/?person=jim, browser display:

Hello Jim




"Python" "Bobo"

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.