Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you are creating non-interactive pages, you can easily setup any modern web server to execute your python script as a CGI. Instead of loading a static file, your web server will return the output of your python script. </p> <p>This isn't very sophisticated, but if you are simply returning the output without needing browser submitted date, this is the easiest way (scaling under load is a different story). </p> <p>You don't even need the "cgi" module from python, if you aren't receiving any data from the browser. Anything more complicated than this and you should use a web framework.</p> <p><strong>Examples and other methods</strong></p> <ul> <li><a href="http://bytes.com/topic/python/answers/34319-apache-web-server-cgi" rel="noreferrer">Simple Example</a>: hardest part is webserver configuration</li> <li><a href="http://bytes.com/topic/python/answers/34319-apache-web-server-cgi" rel="noreferrer">mod_python</a>: Cut down on CGI overhead (otherwise, apache execs the python interpreter for each hit)</li> <li><a href="http://docs.python.org/library/cgi.html" rel="noreferrer">python module cgi</a>: sending data to your python script from the browser.</li> </ul> <p><strong>Sorting</strong></p> <p><a href="http://www.kryogenix.org/code/browser/sorttable/" rel="noreferrer">Javascript side sorting</a>: I've used this javascript library to add sortable tables. This is the easiest way to add sorting without requiring additional work or another HTTP GET.</p> <blockquote> <p>Instructions:<br> Download this file<br> Add to your HTML<br> Add class="sortable" to any table you'd like to make sortable<br> Click on the headers to sort</p> </blockquote>
 

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