Python, ASP - Namespace (again)

Nikolai Kirsebom Nikolai.Kirsebom at
Tue Jun 29 18:15:42 EDT 1999

From: "Nikolai Kirsebom" <nikolai at>

Trying again - since I'm rather stuck, and I would like to stick to Python.

I'm trying to use Python as scripting language on the web-server, however -
have problems to see how the namespace scope is handled.

class GenDb:
   def __init__(self):
      self.ConnStr = ""

   def SetDbAndTable(self, db, table):
      self.Db = db
      self.Table = table
      self.ConnStr = "Driver={Microsoft Access Driver (*.mdb)};
DBQ=f:\\Databases\\%s" % db

   def Attr(self, attrName):
      if attrName == "abc":

from GenDb import *

class KSdebatt(GenDb):
   def __init__(self):
      self.SetDbAndTable("KSdebatt.mdb", "BillMrk")

<%@ LANGUAGE = Python %>
import sys
from KSdebatt import *
<INPUT TYPE="text" NAME="abc" VALUE="<%= o.Attr("abc") %>" SIZE=20>

when I run the statements in the script1.asp file in an interactive window,
I can create the KSdebatt object, however when I run the script on the
server - I  get the following message:

Python ActiveX Scripting Engine error '80020009'
Traceback (innermost last): File "<Script Block >", line 4, in ?
o=KSdebatt() NameError: KSdebatt
/ksdebatt/pages/Script1.asp, line 6

If it is possible I would like to 'hide' the object (o) inside the KSdebatt
module - that is to have the instanciation inside the module itself - but
still be able to access it from the ASP-code in the script (o.Attr....).  Is
this possible ?

I'm running on NT 4.0 SP 3 and python 1.5.2b2

Thanks for any help

Nikolai Kirsebom

More information about the Python-list mailing list