Hello everyone, today we introduce a very lightweight web development framework, Karloop framework. Developing with Python
First we download Karloop source for installation.
Source Address
After the download is successfully unzipped, enter the extracted path, enter the terminal, Run command: sudo python setup.py install
If it is a window system, open cmd, run: Python setup.py install
After the download was successfully installed, we wrote a hello.py
The contents are as follows:
# coding=utf-8
from karloop.KarlBaseApplication import BaseApplication
from karloop.KarlBaseResponse import BaseResponse
class HelloHandler(BaseResponse):
def get(self):
return self.response("hello world")
handlers = {
"/hello": HelloHandler
}
class HelloApplication(BaseApplication):
def __init__(self):
super(HelloApplication, self).__init__(handlers=handlers)
if __name__ == "__main__":
application = HelloApplication()
application.listen(port=8888)
application.run()
At this point, save, run Python hello.py, visit Http://localhost:8888/hello, and the Hello World will appear.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Karloop introduction--hello World Hello, today for you to introduce a very lightweight web development framework, Karloop framework. Using Python development First we download the Karloop source for installation. Download the source address into