|
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.〔(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 ( 1. Python 'chunks' (multiple Python statements with traditional indentation): or 2. Individual statements within delimiters (indentation not required): or 3. Expressions evaluation I am = 5 or I am <%= 5 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). 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Spyce」の詳細全文を読む スポンサード リンク
|