473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

2.5a1 import of .dlls

I've re-built an extension module (as a .dll) using the 2.5a1 release.
Unexpectedly, I'm not able to simply import it (not the way I can when
building it for 2.3). Using imp.load_dynamic() the import succeeds.
import minx # Implemented in a .dll - fails Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named minx import imp # Workaround
import os
minx = imp.load_dynamic('minx', os.getcwd() + '\\minx.dll')


I couldn't find anything to indicate this is by design in 2.5a1 (I did
read the PEP 328: Absolute and Relative Imports) - am I doing something
wrong?

Apr 18 '06 #1
1 1782
sv**********@gmail.com wrote:
I've re-built an extension module (as a .dll) using the 2.5a1 release.
Unexpectedly, I'm not able to simply import it (not the way I can when
building it for 2.3). Using imp.load_dynamic() the import succeeds.
import minx # Implemented in a .dll - fails Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named minx import imp # Workaround
import os
minx = imp.load_dynamic('minx', os.getcwd() + '\\minx.dll')


I couldn't find anything to indicate this is by design in 2.5a1 (I did
read the PEP 328: Absolute and Relative Imports) - am I doing something
wrong?

Extension modules for 2.5 can no longer have the '.dll' extension, they must
have a '.pyd' extension. I don't know why this isn't documented somewhere (although
I would expect it in Misc/NEWS instead of in PEP 328) - you should filke a bug report.

Thomas

Apr 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Markus Doering | last post by:
Hello, I just switched from 2.2 to Python 2.3. I am developing an XML/CGI interface to databases as a python package called "unitWrapper" containing several modules which ran fine under v2.2. ...
1
by: Peter Schwabe | last post by:
Hi all, is it possible to import classes (not functions) from native dlls to c#-Code and if so: how? We found several ways using wrapper-classes importing every particular class method, but that...
79
by: pinkfloydhomer | last post by:
I want to scan a file byte for byte for occurences of the the four byte pattern 0x00000100. I've tried with this: # start import sys numChars = 0 startCode = 0 count = 0
6
by: [Yosi] | last post by:
Hi, I have a general DLL "genDLL.dll",this dll open other dlls by calling generalDll.openDll("dll1.dll"). I mad a form with got dll name in new,and then this for open the new dll by calling the...
1
by: Mythran | last post by:
In other languages, I can create a dll and then use that dll in different languages. Example: Create a library (.dll) using C/C++ and then import functions from the dll's for use in Pascal. I...
1
by: Thomas Klein | last post by:
Hello newsgroup, I am new to C# and need to import a DLLs from a software vendor. I have already successfully tried to import a Win32-DLL in this way: /* * import DLL */
17
by: mohan | last post by:
Hi Guys, I've been using the following IDE, "Pythonwin - Python IDE and GUI Framework for Windows. Copyright 1994-2001 Mark Hammond " With respect to my work, I had created my own modules...
0
by: =?Utf-8?B?UGFy?= | last post by:
Hi I have a question on how to import unmanaged DLLs into Visual Studio 2005, C# environment. The background is that an instrument we bought is controlled through a couple of DLL files. I...
5
by: Stef Mientki | last post by:
hello, The import statement "import sqlite3" gives the error given below. In simple programs, the import statement (sometimes) succeed, and I can indeed access the database. So I guess there is...
3
by: jrh | last post by:
Hello, From previous posts and documentation it seems python should be able to import a module that is compiled into a .dll just as well as a .pyd. I have a pyd that works fine, but after...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.