apache - Using custom module with Python CGI script -


i'm running python cgi script on localhost needs import , use python module wrote. placed cgi script in apache cgi-bin directory (i'm running on windows). i've tried placing custom module in same directory, doesn't seem able import module. prefer not have custom module cgi script called via exec().

you need put python module somewhere python's import can see it. easy ways are:

  • make directory module, , add directory pythonpath environment variable.
  • copy module python site-packages directory, under python installation directory.

in either case, need make sure module's name not same name of other module might imported python in cgi script.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -