473,503 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4513
"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
2795
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++ with extending & embedding PYTHON. It seems not...
3
1635
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 number, but I've hit a problem I can't quite get my...
6
4298
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 the null character: eg coalesce(col1, ' '). This...
2
2007
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. The first time I do this the usercontrol appears on...
3
7159
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 "SQL0964C The transaction log for the database...
2
5931
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 easy-wrapper for the py-tck-stuff. ...
0
975
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 on the exact same file). How would I run...
0
996
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
6364
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 python to C and then from C to python. I have no...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7011
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.