spyce
         
home     documentation     download     Spyce logo


Examples

examples/pool.spy
[[.import names="pool"]]
<html><body>
  The pool module supports long-lived server-pooled objects,<br>
  useful for database connections, and other variables<br>
  that are expensive to compute.<br>
  [[\
    if 'foo' in pool:
      print 'Pooled object foo EXISTS.'
    else:
      pool['foo'] = 1
      print 'Pooled object foo CREATED.'
  ]]
  <br>
  Value: [[=pool['foo'] ]] <p>
</body></html>
Run this code

Back to List of Examples


Spyce logo
Python Server Pages
version 2.1.3
Spyce Powered SourceForge Logo