einfaches cgi script läuft nicht
Verfasst: Montag 20. April 2009, 20:31
Hallo Pythonforum,
ich habe ein Problem mit einem eiinfachen Cgi-Script unter Ubuntu Linux welches unter Windows funktioniert.
Ich bekomme folgende Ausgabe:
in der Konsole bringt aber keinen Fehler. Ich weiß im Moment nicht mehr weiter.
Hat jemand eine Idee?
Gruß
alpha
ich habe ein Problem mit einem eiinfachen Cgi-Script unter Ubuntu Linux welches unter Windows funktioniert.
Code: Alles auswählen
#!/usr/bin/python
import time
print "Content-Type: text/html" # Header
print
print "<html><head><title> CGI-Script </title></head>"
print '<meta http-equiv="refresh" content="25; URL=mycgi.py">'
print "<body><h1>Datum und Zeit</h1>"
#print "Es ist ", time.ctime( time.time() ) + "."
print time.ctime()
print "</body></html>"
Ich bekomme folgende Ausgabe:
Aus irgendeinem Grund kennt der interpreter ctime nicht.Original exception was:
Traceback (most recent call last):
File "/home/alpha/scripts/python/cgi-bin/mycgi.py", line 2, in <module>
from time import *
File "/home/alpha/scripts/python/cgi-bin/time.py", line 9, in <module>
print time.ctime()
AttributeError: 'module' object has no attribute 'ctime'
localhost - - [20/Apr/2009 21:20:21] CGI script exit status 0x100
Code: Alles auswählen
import time
time.ctime()
Hat jemand eine Idee?
Gruß
alpha