469,303 Members | 1,877 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,303 developers. It's quick & easy.

How to load the DLL with PyRun_SimpleString?

Hi,

Have anyone know how to import the DLL in C program?
Actually, I have used the statement 'PyRun_SimpleString' to import .PY,

Such as,
r = PyRun_SimpleString("import os");
It's be fine.
If importing the DLL by this commdand,

Such as,
r = PyRun_SimpleString("import example");

return the error code -1.
Should any advice, let me know whatever you try...

Thanks in advance.
Link
Jul 18 '05 #1
3 4335
"Link" <li******@hotmail.com> writes:
Hi,

Have anyone know how to import the DLL in C program?
Actually, I have used the statement 'PyRun_SimpleString' to import
.PY,
Such as,
r = PyRun_SimpleString("import os");
It's be fine.
If importing the DLL by this commdand,

Such as,
r = PyRun_SimpleString("import example");

return the error code -1.


Is the .dll named .pyd? Is the .pyd on your sys.path?
--

Vennlig hilsen

Syver Enstad
Jul 18 '05 #2
Exactelly, the named example is .DLL and put it on the sys.path.

That I had check it carefully.
But the result make me sad what I failed to load.

Could you give me more advice? Such as the other statement for loading DLL
as same as the 'PyRun_SimpleString' command.

Regards,
Link

"Syver Enstad" <sy*************@online.no>
???????:u1***********@online.no...
"Link" <li******@hotmail.com> writes:
Hi,

Have anyone know how to import the DLL in C program?
Actually, I have used the statement 'PyRun_SimpleString' to import
.PY,
Such as,
r = PyRun_SimpleString("import os");
It's be fine.
If importing the DLL by this commdand,

Such as,
r = PyRun_SimpleString("import example");

return the error code -1.


Is the .dll named .pyd? Is the .pyd on your sys.path?
--

Vennlig hilsen

Syver Enstad

Jul 18 '05 #3
"Link" <li******@hotmail.com> writes:
Exactelly, the named example is .DLL and put it on the sys.path.


Rename the .dll to .pyd.

--

Vennlig hilsen

Syver Enstad
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Link | last post: by
3 posts views Thread by Bill Orcutt | last post: by
6 posts views Thread by JS | last post: by
2 posts views Thread by **Developer** | last post: by
3 posts views Thread by db2udbgirl | last post: by
2 posts views Thread by iwl | last post: by
reply views Thread by iwl | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.