LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 09-05-2005, 12:22 AM   #1
hus
Member
 
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/apache.py", line 299, in HandlerDispatch
result = object(req)

File "/usr/lib/python2.4/site-packages/mod_python/psp.py", line 297, in handler
p.run()

File "/usr/lib/python2.4/site-packages/mod_python/psp.py", 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

Code:
<%-- import time module --%>

<%@ page imports = "time"%>



<table>

   <tr>

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

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

            font-weight: bold">



            <%= time.ctime() %>

         </p> 

      </td>

   </tr>

</table>
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, 08:53 PM   #2
-X-
Member
 
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

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

Actually, I remembered the time/time.ctime() thing from an old PSP article. letme see........ yeah, here it is;
http://www.onlamp.com/pub/a/python/2...ver_pages.html

This site has a real good Python Wiki section here;
http://wiki.linuxquestions.org/wiki/Python
The "tips" link is excellent.

HTH
 
  


Reply


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 11:50 AM
Getting the web page in python :: What's wrong with the code ? indian Programming 1 09-12-2005 03:17 PM
Python: loading page from forum fiomba Linux - Software 13 11-24-2004 09:51 AM
How to fetch source from a web page with Python rootyard Programming 1 07-19-2004 01:56 PM
I cant change the default test page in apache server to add my page.y nhemapriya Linux - Newbie 3 05-13-2004 12:35 PM


All times are GMT -5. The time now is 09:12 PM.

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