Python
  Home arrow Python arrow Using Spyce
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PYTHON

Using Spyce
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 9
    2006-01-17


    Table of Contents:
  • Using Spyce
  • Basic Syntax
  • Active Tags
  • Handling Form Data

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Using Spyce
    ( Page 1 of 4 )

    If you are looking for a way to embed Python within HTML you might want to take a look at a web environment called Spyce. Two of its advantages are its features and its flexibility. Keep reading to learn how you can Spyce up your programs.

    Introduction

    The idea of “Python Server Pages” is nothing new or unique to one particular web environment. It's an idea that is featured in several environments, including mod_python and Karrigell. However, while mod_python and Karrigell don't completely focus on embedding Python within HTML, a web environment named Spyce does. Spyce allows for Python to be embedded, but it also contains a few more tricks when it comes to embedding, such as active tags. Moreover, the fact that Spyce can be used with several technologies with minimal configuration is a huge advantage. In this article, we'll take a look at how Spyce is configured and what it offers.

    Installing Spyce

    Spyce can be obtained at SourceForge:

    http://sourceforge.net/project/showfiles.php?group_id=53655

    Simply download the archive and extract it to a directory that's easily accessible.

    Spyce can be installed in numerous ways, which is convenient since you probably won't have to change the face of your existing environment in order to benefit from Spyce. You may choose to run Spyce as its own web server, which can run behind Apache, or you can use FastCGI, mod_python or plain old CGI. Spyce already comes with configuration directives that can be slightly modified and then used with Apache.

    To run Spyce as its own web server, open the directory where you extracted spyce and run the file spiceCmd.py with the “-l” flag:

    spyceCmd.py -l

    Spyce is configured to run on port 8000 by default. If you wish to have Spyce listen to a different port, open the file spyceconf.py and change the port variable.

    The remaining installation options require spyceApache.conf to be modified. Open it up and replace “XXX” with the directory to where you extracted Spyce. The file contains configuration directives for running Spyce behind Apache, running Spyce with FastCGI or CGI and running Spyce through mod_python. Simply uncomment the appropriate section of the file and make sure that all other sections are commented. Next, make a copy of spyceApache.conf and drop it in the conf directory of your Apache installation. Open up Apache's httpd.conf and add this directive to the end:

    Include conf/spyceApache.conf

    Spyce should now be configured to work with your method of choice.



     
     
    >>> More Python Articles          >>> More By Peyton McCullough
     

       

    PYTHON ARTICLES

    - Tuples and Other Python Object Types
    - The Dictionary Python Object Type
    - String and List Python Object Types
    - Introducing Python Object Types
    - Mobile Programming using PyS60: Advanced UI ...
    - Nested Functions in Python
    - Python Parameters, Functions and Arguments
    - Python Statements and Functions
    - Statements and Iterators in Python
    - Sequences and Sets in Python
    - Python Expressions and Operators
    - Dictionaries, Variables and Statements in Py...
    - Data Types in Python
    - The Python Language
    - SSH with Twisted





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek