Anders Dahlqvist dahqlvist at sundsvall.mail.telia.com
Fri Jun 6 15:29:15 CEST 2003

I'm a total newbie to cgi-programming in python, so please bear with me.
I've written a script (see below) that doesn't do what I want it to, i.e
work as a standalone program
#!/usr/bin/env python

import os,time,cgi,cgitb
from data import * 


def htmlstart(titel):
        print  htmlhuvud % (titel, titel, time.strftime("%F %X",time.localtime()))

def htmlstop():
        print htmlslut

def tabell(typ):
        if typ in lista0:
                tabellhuvud="<TABLE BORDER=1><TR><TH>databas</TH><TH>url</TH></TR>"
                html=os.popen("mysql --host=loke --user=apache arbeten --exec='select
databas,url from rekrytering where %s=1'" % typ).readlines() 
        elif typ in lista1:
                html=os.popen("mysql --host=loke --user=apache arbeten --exec='select
databas,url,email from rekrytering where %s=1'" % typ).readlines()
        print tabellhuvud
        #Skapa en ny lista, innehållande listor med  varje rad i en egen lista
        for rad in html:

        if typ in lista0:
                for underlista in lista[1:-1]:#Första raden ingår i tabellhuvud
                        print "<TR><TD>%s</TD><TD><A HREF='%s'>%s</A></TD></TR>" %
        elif typ in lista1:
                for underlista in lista[1:-1]:
                        print "<TR><TD>%s</TD><TD><A HREF='%s'>%s</A></TD><TD><A
HREF='mailto:%s'>%s</A></Td></TR>" %
        print tabellslut

The problem i have that it doesn't work as  a standalone program(i.e it
doesn't recognize the variables titel and typ), when i try to access it via
although it works when invoked from (code below)
#!/usr/bin/env python 

import funktioner


What am I doing wrong here?

Best regards

Anders Dahlqvist
In a minimum-phase system there is an inextricable link between
frequency response, phase response and transient response, as they
are all merely transforms of one another.  This combined with
minimalization of open-loop errors in output amplifiers and correct
compensation for non-linear passive crossover network loading can
lead to a significant decrease in system resolution lost.  However,
this all means jack when you listen to Pink Floyd.

More information about the Python-list mailing list