Michael Lunnay wrote: > is there a standard way to detect if script is being > run as a cgi script or from the command line. I usually build test cgi scripts by checking for the SERVER_PROTOCOL environment variable, e.g.: if os.environ.has_key('SERVER_PROTOCOL'): run() else: test() Hope that helps. Jeff Bauer Rubicon Research