472,353 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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 4442
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Link | last post by:
Dear, How is the wonderful PYTHON for me. It attracts me with its additional variety. I am developing in C program as well as first to use C++...
3
by: Bill Orcutt | last post by:
Having seen the number of lost souls asking questions about embedding Python in the archives of this group, I hesitate to add myself to their...
6
by: JS | last post by:
EE instance DB2 v7.2.0 fixpack 3 on WIN2K. I select some data from a table A and write it to a file using the COALESCE function and whitespace as...
2
by: **Developer** | last post by:
I have a Form (FV&C) containing a userconrtrol (CF&E) I do a ShowDialog for the form and the form's Load calls a method of the UserControl. ...
3
by: db2udbgirl | last post by:
Env: DB2 UDB 8.2, AIX 5.3 While trying to load data (73 Million rows, Medium size table uses 4K tablespace) into a table using cursor it fails with...
2
by: iwl | last post by:
Hello, I'm just starting with Python - would like to embed it in my windows-programm as an script-processor. For tests I use easygui some...
0
by: sndive | last post by:
I want to step into PyImport_ImportModule("my_foo") that's failing despite the my_foo.py being in the current directory. (PyRun_SimpleFileEx works...
0
by: iwl | last post by:
Hi, it seems like I can't trace scripts run by PyRun_SimpleString(): a=0 def test(frame, event, arg): global a a+=1 import sys
3
by: ShambhuHubli | last post by:
Hi all!! .. I am New member to this group. And also new to C/PYTHON API coding. I am trying to have two way communication i,e i am calling from...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.