A quick tour of examples of Karrigell in action
- hello.py

- The Python script which prints the message "Hello Karrigell !"
- hello1.py

- The same, but with content-type set to "text/plain"
- test.pih

- A base test of a Python Inside HTML script, which prints HTTP headers, namespace, the
list of modules available in this namespace, a computing of square
- test.hip

- A base test of HTML Inside Python script which prints HTTP headers, cookies, some
calculation
- ksTest.ks

- A complete "Karrigell Service" in one script
- cheetahTest.py

- For those who prefer templating systems, the popular Cheetah engine is included in
the package. This script shows how to use it : create a Python script to define the variables,
then use Include() and pass the variables in the script to the included template file
cheetahTest.tmpl
- globalTest.py

- Uses a "global" module, called
myScript
, available in all scripts (this is specified in the configuration file)
- myForm.htm

- An HTML form sent to the Python script
myScript.py
, which print entered values
- fileUpload.html

- An HTML form sent to the Python script
fileUpload.py
, showing how to handle file uploads
- includeDemo.py

- A Python script which shows the use of the Include() function. The included
script is
footer.py
which in turn includes
includedFooter.py
. The variable THIS
changes for every script
- htmlTagsTemplateTest.py

- HTMLTags is a module to generate HTML from Python code. In this example I use it in a
template module
htmlTagsTemplate.py

This module uses the names
clients
and title
, they are provided as keyword arguments in the
function Include()
- authenticationTest.pih

- Shows how to use the authentication function, with a simple test function ; the values
to enter are "holden" and "caulfield"
- redirect.py

- Redirection to another URL (in this particular case, my website about Breton songs...)
- scriptErrorTest.pih

- A script with a volontary error, to show how Karrigell prints error messages.
The "Debug" button gives access to the debugger, which shows the script source code and
allows to see the state of variables when the error occured. See also
other errors
- scriptEndTest.py

- A script with a SCRIPT_END exception which allows script interruption before a line
which causes an error
- tabsDemo.pih

- Shows a menu with horizontal tabs
- sessionTestForm.htm

- An HTML form whose data are stored using the session mechanism. Validating data causes a
call to the script
sessionTestBegin.pih
which initializes the session object from form fields. The
following script, sessionTestFollow.pih
shows that data are indeed retrieved through this object
- thisTest.pih

- Shows the attributes of the object
THIS
- requestHandlerTest.pih

- Shows the attributes of the object
REQUEST_HANDLER
- importTest.hip

- This script only imports another one,
importTest.py
and prints a value from this imported script. If the reload_modules
option has been set to 1 in the initialization file (Karrigell.ini
), when the value is changed in importTest.py (by editing the file in a text editor) then if you reload importTest.pih the value also changed. If reload_modules
is not set, the change has no effect
This avoids having to restart the server every time an imported file is changed