programme zicken herum
Verfasst: Sonntag 20. Mai 2007, 09:28
ich ärger mich mit unauffindbaten fehlern herum
warum bekomme ich bei anzgif++ die meldung invalid syntax
dann hab ich noch ein 2tes prog dass im idle funtz aber im cgi nicht:
warum bekomme ich bei anzgif++ die meldung invalid syntax
Code: Alles auswählen
#!/usr/bin/python
try:
f = file('test-access-log.txt', 'r')
anzgif=0
while True:
line = f.readline()
if len(line) == 0:
break
if line.find(gif,0,-1)!= -1:
anzgif++
f.close()
print "Gif Aufrufe:"+`AnzGif` +"\n"
except IOError:
Code: Alles auswählen
#!/usr/bin/env python
print 'Content-Type: text/html\n\n'
print''
import cgi
import cgitb
cgitb.enable()
print '<html>\n'
import time
hour, minute, second = time.localtime()[3:6]
wert= hour*minute*second*190
schrift=wert^2147483647
hexwert =hex(wert)
hexschrift =hex(schrift)
print'''<head> <title>Dynamische Hintergrundfarbe</title> </head>
<body bgcolor=\"''' +hexwert[2:]+'''\" text="'''+hexschrift[2:]+'''
><h1>'''+ time.ctime()+'''</h1></body></html>'''
Content-Type: text/html --> --> -->
Traceback (most recent call last):
File "time.py", line 4, in ?
import cgi
File "/usr/lib/python2.3/cgi.py", line 39, in ?
import urllib
File "/usr/lib/python2.3/urllib.py", line 28, in ?
import time
File "/home/stud2/rkammers/public_html/cgi-bin/time.py", line 15, in ?
hour, minute, second = time.localtime()[3:6]
AttributeError: 'module' object has no attribute 'localtime'