Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Spyce (software)

From Wikipedia, the free encyclopedia
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Spyce" software – news ·newspapers ·books ·scholar ·JSTOR
(May 2021) (Learn how and when to remove this message)
Spyce
Websitespyce.sourceforge.netEdit this at Wikidata

Spyce is technology similar toPHP that can be used to embedPython code intowebpages. Spyce isfree software, distributed under aBSD-style licence, with some additional restrictions about documentation notices.[1][2][3][4][5][6]

Common Spyce embedding methods

[edit]

Since Python uses indentation to determine the beginning and end of a block, Spyce includes several ways to embed Pythoncode. Shown below are the three most common ways.Spyce supportsASP/JSP-styledelimiters (<% and%>) as well as double braces ([[ and]])

  1. Python 'chunks' (multiple Python statements with traditionalindentation):
    It's<b>[[\from time import asctime, localtimeprint(asctime(localtime()))]]</b> right now!

    or

    It's<b><%\fromtimeimportasctime,localtimeprint(asctime(localtime()))%></b>rightnow!
  2. Individual statements within delimiters (indentation not required):
     [[for x in xrange(3): {]]<b>Hello,</b> [[}]]

    or

    <%forxinxrange(3):{%><b>Hello,</b><%}%>
  3. Expressions evaluation
    <b>I am [[= 5*3]] years old.</b>

    or

    <b>Iam<%=5*3%>yearsold.</b>

The techniques above can be freely mixed and embedded in anyHTML 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 (usingexception handling andunit testing single modules individually).

Features

[edit]

Some other features include custom tags (ala JSP), spycelambdas andactive handlers (reminiscent of ASP).

Requirements

[edit]

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.

See also

[edit]

References

[edit]
  1. ^Spyce - Python Server Pages (PSP)
  2. ^Petreley, Nicholas (2002-11-11)."PHP and Python Hit Prime Time".Computerworld. Retrieved2021-10-03.
  3. ^"Release (#25976) - Spyce - Python Server Pages - OSDN".osdn.net. Retrieved2021-10-03.
  4. ^"SPYCE - Python Server Pages".www.onworks.net. Retrieved2021-10-03.
  5. ^"Spyce Development Tips and Techniques".Neotitans Technologies Inc. Retrieved2021-10-03.
  6. ^Lutz, Mark; Ascher, David (2003-12-23).Learning Python. "O'Reilly Media, Inc.".ISBN 978-0-596-55193-3.

External links

[edit]
.NET
C++
ColdFusion
Common Lisp
Haskell
Java
JavaScript
Back end
Server-side
Full-stack
Front end
Client-side
Perl
PHP
Python
Ruby
Rust
Scala
Smalltalk
Other languages


Stub icon

Thisprogramming-language-related article is astub. You can help Wikipedia byadding missing information.

Retrieved from "https://en.wikipedia.org/w/index.php?title=Spyce_(software)&oldid=1305277860"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp