1

Possible Duplicate:
Python import dll

I am trying to load a c dll located at the same path where my .py script is, still I can not load the dll.

module = PyImport_ImportModule("<module-name.dll>");

Any suggestion.

Community
  • 1
  • 1
  • It doesn't not use PyImport_ImportModule also I don't want to use Cython.. –  May 26 '12 at 14:54
  • Sorry, I never did anything similar before. Have you tried supply only the module name (without .dll)? – nhahtdh May 26 '12 at 15:01

1 Answers1

0

You must call the line below to set your current directory in path, that is because by default, the current directory is not in the search path:

PySys_SetPath("."); 
mymod = PyImport_ImportModule("your_DLL_name or Py_module_name");

Once you have above code the C DLL or Python module will be loaded.

AvkashChauhan
  • 20,495
  • 3
  • 34
  • 65