Spyce

Spyce

Spyce is technology similar to PHP that can be used to embed Python code into webpages. Spyce is free software, distributed under a BSD-style licence, with some additional restrictions about documentation notices [ [http://spyce.sourceforge.net/docs/license.html Spyce - Python Server Pages (PSP) ] ] .

Common Spyce Embedding Methods

Since Python uses indentation to determine the beginning and end of a block, Spyce includes several ways to embed Python code. Shown below are the three most common ways. Spyce supports ASP/JSP-style delimiters (<% and %>) as well as double braces ( and ).

1. Python 'chunks' (multiple Python statements with traditional indentation):

It's

from time import asctime, localtimeprint asctime(localtime())

right now!

or

It's <%

from time import asctime, localtimeprint asctime(localtime())

%> right now!

2. Individual statements within delimiters (indentation not required):

Hello, }

or

<% for x in xrange(3): { %> Hello, <% } %>

3. Expressions evaluation

I am = 5*3 years old.

or

I am <%= 5*3 %> years old.

The techniques above can be freely mixed and embedded in any HTML document.

Any legal Python code can be embedded and any Python module can be imported, which makes it especially suited for writing very robust applications (using exception handling and unit testing single modules individually).

Features

Some other features include custom tags (ala JSP), spyce lambdas and active handlers (reminiscent of ASP).

Requirements

Spyce brings Python's standard library and the programming language itself to the web. The minimum requirement is a working Python installation (it ships with a standalone web server written in Python that can be used during development), although it can be used in conjunction with several web servers such as Apache and IIS in a variety of ways.

Configuration is done using Python modules that are imported by the web server during initialization, so all that is really required to get started with Spyce is basic knowledge of Python.

References

See also

* mod_python
* [http://www.neotitans.com/resources/spyce-tips-and-techniques.html Spyce Tips and Techniques]

External links

* [http://spyce.sourceforge.net/ http://spyce.sourceforge.net/] (Official website)


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • spyce — obs. form of spice …   Useful english dictionary

  • Mod python — ist ein Modul für den Apache HTTP Server, das die Programmiersprache Python in den Webserver einbindet. Ziel war die Ablösung des „Common Gateway Interface“ (CGI) zur Ausführung von Python Skripten. Vorteil ist hauptsächlich die schnellere… …   Deutsch Wikipedia

  • Python Server Page — mod python ist ein Modul für den Apache HTTP Server, das die Programmiersprache Python in den Webserver einbindet. Ziel war die Ablösung des „Common Gateway Interface“ (CGI) zur Ausführung von Python Skripten. Vorteil ist hauptsächlich die… …   Deutsch Wikipedia

  • Список CMF — Это список CMF  каркасных систем для управления содержимым (в основном, содержимым сайтов). Как правило, на основе CMF создаются CMS  готовые системы управления содержимым, а те, в свою очередь, служат основой для создания полноценных… …   Википедия

  • Mod python — is an Apache HTTP Server module that integrates the Python programming language into the Apache server. It is intended to replace Common Gateway Interface (CGI) as a method of executing Python scripts on a web server. The promised benefits are… …   Wikipedia

  • XBMC — Media Center XBMC Media Center Home Screen Developer(s) …   Wikipedia

  • CherryPy — Developer(s) CherryPy team Stable release 3.2.0 / February 25, 2011; 8 months ago (2011 02 25) Written in Python …   Wikipedia

  • Django (web framework) — Django The default Django page Developer(s) Lawrence Jou …   Wikipedia

  • List of web application frameworks — This is a list of notable web application frameworks, used for creating web applications. Client side ActionScript * Cairngorm * PureMVCJavaScript* Backbase * CJAX * Clean AJAX * Dojo Toolkit * Echo * Ext * [http://www.gapjumper.com/ Gapjumper] * …   Wikipedia

  • Rip the Jacker — Infobox Album Name = Rip the Jacker Type = studio Artist = Canibus Released = July 22 2003 Recorded = 2002–2003 Genre = East Coast hip hop, hardcore hip hop Length = 44:56 Label = Mic Club/Babygrande Producer = Stoupe the Enemy of Mankind Reviews …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”