Newbie Needs Help -- Name and Key errors
effbot at telia.com
Tue Apr 25 18:28:34 CEST 2000
Bob Langdon <bingdo19 at earthlink.net> wrote:
> New to Python, and moving a site for a client. The backend sas developed
> by another developer in Python. I've i9nstalled Python1.5.2 in my home
> direcpory and tested it. The interpreter seems to functioning properly.
> However, some paths seem to be defined incorrectly.
> When running a script "getresume.py" for example,
> import sys
> sys.stderr = sys.stdout
> import os
> from calendar import month_name
> from types import *
> from formhandler import FormHandler
> from string import strip, split, join, atol, atof, upper, lower,
> from refer import getReferer, addGetResume
> from time import asctime, localtime, time, strftime
> from urllib import quote_plus, unquote_plus
> from fcsetup import LOCALHOSTNAME
> from fcsetup import *
> import Mail
> print '<pre>\n'
> import traceback
> print sys.path
> resumeDIR = DEPOT
just guessing here, but it looks like
1) you need to the DOCUMENT_ROOT environment variable
before running the script
2) the fcsetup.py module should define a variable called DEPOT,
> I think DEPOT might be a reference to the MySQL database, using the
> Berkley dbmodule (which I can't find). I certainly can't find a
> directory named DEPOT anywhere on the old host's server.
DEPT is a variable name, not a directory name. the "from
fcsetup import *" line imports all variables from the fcsetup
> Neither can I fathom where "DOCUMENT_ROOT" is defined, or find a file
> called "os.environ."
"os.environ" refers to a variable in the standard "os" module,
not a file. see the library reference for more info.
More information about the Python-list