Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>"how easy is CGI programming in python?" Easier than C, that's for sure. Python is easier because -- simply -- it's an easier language to work with than C. First and foremost: no memory allocation-deallocation. Beyond that, the OO programming model is excellent.</p> <p>Beyond the essential language simplicity, the Python <a href="http://www.wsgi.org/wsgi/" rel="nofollow noreferrer">WSGI</a> standard is much easier to cope with than the CGI standard.</p> <p>However, raw CGI is a huge pain when compared with the greatly simplified world of an all-Python framework (<a href="http://turbogears.org/" rel="nofollow noreferrer">TurboGears</a>, <a href="http://www.cherrypy.org/" rel="nofollow noreferrer">CherryPy</a>, <a href="http://www.djangoproject.com/" rel="nofollow noreferrer">Django</a>, whatever.)</p> <p>The frameworks impose a lot of (necessary) structure. The out-of-the-box experience for a CGI programmer is that it's too much to learn. True. All new things are too much to learn. However, the value far exceeds the investment.</p> <p>With Django, you're up and running within minutes. Seriously. <code>django-admin.py startproject</code> and you have something you can run almost immediately. You do have to design your URL's, write view functions and design page templates. All of which is work. But it's <em>less</em> work than CGI in C. </p> <p>Django has a better architecture than PHP because the presentation templates are completely separated from the processing. This leads to some confusion (see <a href="https://stackoverflow.com/questions/276345/syntax-error-whenever-i-put-python-code-inside-a-django-template">Syntax error whenever I put python code inside a django template</a>) when you want to use the free-and-unconstrained PHP style on the Django framework.</p> <p><strong>linking the user interface to the back-end</strong></p> <p>Python front-end (Django, for example) uses Python view functions. Those view functions can contain any Python code at all. That includes, if necessary, modules written in C and callable from Python.</p> <p>That means you can compile a <a href="http://clipsrules.sourceforge.net/" rel="nofollow noreferrer">CLIPS</a> module with a Python-friendly interface. It becomes something available to your Python code with the <code>import</code> statement.</p> <p>Sometimes, however, that's ineffective because your Django pages are waiting for the CLIPS engine to finish. An alternative is to use something like a named pipe.</p> <p>You have your CLIPS-based app, written entirely in C, reading from a named pipe. Your Django application, written entirely in Python, writes to that named pipe. Since you've got two independent processes, you'll max out all of your cores pretty quickly like this.</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