View the Most Wanted LQ Wiki articles.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-05-2005, 01:22 AM   #1
Registered: Dec 2003
Location: Bangkok- Thailand
Distribution: Mandriva 10.0,Fedora Core 4
Posts: 79

Rep: Reputation: 15
Python Server Page Problem on FC4

I found this errror message.

Mod_python error: "PythonHandler mod_python.psp"

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/mod_python/", line 299, in HandlerDispatch
result = object(req)

File "/usr/lib/python2.4/site-packages/mod_python/", line 297, in handler

File "/usr/lib/python2.4/site-packages/mod_python/", line 208, in run
exec code in global_scope

File "/var/www/html/ch25/clock2.psp", line 1, in ?

NameError: name 'time' is not defined

Below code is psp sourcecode that I copy from the book

<%-- import time module --%>

<%@ page imports = "time"%>



      <td style = "background-color: black">

         <p class = "big" style = "color: cyan; font-size: 3em; 

            font-weight: bold">

            <%= time.ctime() %>




And code below is contained in my .htacess file
AddHandler mod_python .psp
PythonHandler mod_python.psp
PythonDebug On

For simple code like <%="Hello world!"%> is Ok
I use mod_python from FC4 package.
How to solve this problem.

Thanks in advance.
Old 09-05-2005, 09:53 PM   #2
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
<%@ page imports = "time"%>
<% import time %>

Actually, I remembered the time/time.ctime() thing from an old PSP article. letme see........ yeah, here it is;

This site has a real good Python Wiki section here;
The "tips" link is excellent.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
FC4 eMachines ndiswrapper problem (don't think it has anything to do with FC4) unknownmosquito Linux - Laptop and Netbook 2 12-04-2005 12:50 PM
Getting the web page in python :: What's wrong with the code ? indian Programming 1 09-12-2005 04:17 PM
Python: loading page from forum fiomba Linux - Software 13 11-24-2004 10:51 AM
How to fetch source from a web page with Python rootyard Programming 1 07-19-2004 02:56 PM
I cant change the default test page in apache server to add my page.y nhemapriya Linux - Newbie 3 05-13-2004 01:35 PM

All times are GMT -5. The time now is 07:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration