I've been using javascript a lot these days, but sometimes I think "I just want some logic on the server side ...".
If you want to do something on the server side, PHP seems to be convenient, but I wonder if there is something in C # or Python that I am familiar with ... Bottle I decided to try / docs / dev /).
A similar one is CherryPy, which I thought was a fairly lightweight framework, but Bottle is even lighter. (Only one .py file)
main_cherry.py
import cherrypy
class HelloWorld( object ):
def index( self ):
return "Hello World!"
index.exposed = True
cherrypy.quickstart( HelloWorld() )
Here is the description in Bottle.
main_bottle.py
from bottle import route, run, template
@route('/')
def index():
return 'Hello World!'
run( host = 'localhost', port = 8080 )
Both are short enough, but Bottle works with just one Python file you need.
This article is a port of the article from Mizu Nagi Kobo to Qiita.
Recommended Posts