#!/usr/bin/env python # show python where the web modules are import sys sys.path.append('../') sys.path.append('../../../') import web, web.session, os session = web.session.start( storage='file', app='test', dir='../doc/src/lib/example-web-session', expire=10, ) print "Content-type: text/html\n\n" if session.created: print """
Setting variable1 to 'Python Rules!'.
Refresh this page...
""" session['variable1'] = 'Python Rules!' else: if web.cgi.has_key('destroy'): session.destroy() print """variable1: %s
"""%(session['variable1'],os.environ['SCRIPT_NAME'])