Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I would recommend checking out CherryPy. It's really easy to wrap your head around and get a quick server up and running - it doesn't have the overhead/complexity that a lot of other frameworks impose (Django!!). Unfortunately you will have to rewrite the UI in html, but ultimately it will most likely be worth the effort. Check out Twitter's Bootstrap to get the ball rolling on a quick and attractive UI that just "works".</p> <p>An example of how concise a CherryPy app can be:</p> <pre><code>import cherrypy class SessionExample: @cherrypy.expose def index ( self ): if cherrypy.session.has_key ( 'color' ): out = "&lt;font color='{0}'&gt;{0}&lt;/font&gt;".format(cherrypy.session['color']) else: out = "" return out + ("&lt;form method='POST' action='setColor'&gt;\n" "Please choose a color:&lt;br /&gt;\n" "&lt;select name='color'&gt;\n" "&lt;option&gt;Black&lt;/option&gt;\n" "&lt;option&gt;Red&lt;/option&gt;\n" "&lt;option&gt;Green&lt;/option&gt;\n" "&lt;option&gt;Blue&lt;/option&gt;\n" "&lt;/select&gt;&lt;br /&gt;\n" "&lt;input type='submit' value='Select' /&gt;\n" "&lt;/form&gt;" @cherrypy.expose def setColor (self, color): cherrypy.session ['color'] = color return "Color set to {}".format(color) cherrypy.config.update({ "server.socketPort" = 8080, "server.environment" = "development", "server.threadPool" = 10, "sessionFilter.on" = True }) cherrypy.root = SessionExample() cherrypy.server.start() </code></pre> <p>Navigate to localhost:8080 in a web browser and you should see a color picker. Simple!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload