Re: Byte arrays and DLLs

2022-07-03 Thread Rob Cliffe via Python-list
That worked.  Many thanks Eryk. Rob On 30/06/2022 23:45, Eryk Sun wrote: On 6/30/22, Rob Cliffe via Python-list wrote: AKAIK it is not possible to give ctypes a bytearray object and persuade it to give you a pointer to the actual array data, suitable for passing to a DLL. You're overlooking t

Re: Byte arrays and DLLs

2022-07-02 Thread Edmondo Giovannozzi
Il giorno venerdì 1 luglio 2022 alle 00:46:13 UTC+2 ery...@gmail.com ha scritto: > On 6/30/22, Rob Cliffe via Python-list wrote: > > > > AKAIK it is not possible to give ctypes a bytearray object and persuade > > it to give you a pointer to the actual array data, suitable for passing > > to a

Re: Byte arrays and DLLs

2022-06-30 Thread Eryk Sun
On 6/30/22, Rob Cliffe via Python-list wrote: > > AKAIK it is not possible to give ctypes a bytearray object and persuade > it to give you a pointer to the actual array data, suitable for passing > to a DLL. You're overlooking the from_buffer() method. For example: >>> ba = bytearray(10)

Byte arrays and DLLs

2022-06-30 Thread Rob Cliffe via Python-list
I have an application in which I wanted a fixed-length "array of bytes" (that's intended as an informal term) where I could read and write individual bytes and slices, and also pass the array to a DLL (one I wrote in C) which expects an "unsigned char *" parameter. I am using ctypes to talk to t

Re: Load python from different plugin dlls

2020-02-13 Thread R.Wieser
Eko, > My test looks like this right now. And there you have a probem, as I have no experience with what those functions do. The below is therefore just a bit of educated guessing, so caveat emperor. > According to the docs PyImport_AppendInittab should be called > before Py_Initialize And

Re: Load python from different plugin dlls

2020-02-13 Thread Eko palypse
Thanks for the information. My test looks like this right now. I have two plugins which, when loaded separately, work. But when both are loaded, I get AccessVioletion messages from python37.dll. The init code for both dlls is this: cpp_init_code = f'''#include #include &qu

Re: Load python from different plugin dlls

2020-02-12 Thread R.Wieser
Eko, > which needs also access to python3.dll but cannot load it itself as it has > been already loaded by plugin1 > > Is such a scenario actually possible? Yes. Normally a DLL can be loaded in as many processes (and threads thereof) as you like. However, it is possible t

Load python from different plugin dlls

2020-02-12 Thread Eko palypse
Assuming there is an CppApp which allows extending its functionality by adding plugins. Now let's assume there are plugin developer which use cython to create such a plugins. How can one check if there has been already a plugin loaded which itself loaded a python interpreter? And if this is po

DLLs folder on Windows

2013-01-16 Thread Piotr Dobrogost
Hi! I'm curious how dlls from the DLLs folder on Windows are being loaded? As they are not placed in the same folder where python.exe resides I guess they must be loaded by giving the path explicitly but I'm not sure. I'm asking because there's no DLLs folder being c

Re: Checking for dlls in ctypes

2012-10-13 Thread 88888 Dihedral
Wanderer於 2012年10月12日星期五UTC+8下午11時36分27秒寫道: > I'm trying to write some code that will load one of three dll depending on > the one available. I've tried the code below, but it doesn't work. The try > except doesn't catch the exception. Is there a way to do this? > > > > try: > >

Re: Checking for dlls in ctypes

2012-10-13 Thread Nobody
On Fri, 12 Oct 2012 12:28:17 -0400, Dave Angel wrote: > Using bare excepts is almost never a good idea. If it "works" you get no > clues what went wrong. For example, a typo in source code can trigger a > bare exception, as can a user typing Ctrl-C. So when you're using bare > excepts, you hav

Re: Checking for dlls in ctypes

2012-10-12 Thread Wanderer
led pvcam32" > > > else: > > > print "installed pvcam64" > > > > > > > I can't help you find the dll's, because I don't run Windows. But I > > could help you write a clearer question: > > >

Re: Checking for dlls in ctypes

2012-10-12 Thread Wanderer
On Friday, October 12, 2012 12:57:06 PM UTC-4, MRAB wrote: > On 2012-10-12 16:36, Wanderer wrote: > > > I'm trying to write some code that will load one of three dll depending on > > the one available. I've tried the code below, but it doesn't work. The try > > except doesn't catch the exception

Re: Checking for dlls in ctypes

2012-10-12 Thread MRAB
On 2012-10-12 16:36, Wanderer wrote: I'm trying to write some code that will load one of three dll depending on the one available. I've tried the code below, but it doesn't work. The try except doesn't catch the exception. Is there a way to do this? try: self.dll = windll

Re: Checking for dlls in ctypes

2012-10-12 Thread Dave Angel
t;installed pvcam32" > else: > print "installed pvcam64" > I can't help you find the dll's, because I don't run Windows. But I could help you write a clearer question: "doesn't work" is thoroughly useless for describing err

Checking for dlls in ctypes

2012-10-12 Thread Wanderer
I'm trying to write some code that will load one of three dll depending on the one available. I've tried the code below, but it doesn't work. The try except doesn't catch the exception. Is there a way to do this? try: self.dll = windll.pvcam64 except: prin

Using MSW GUI DLLS: PYWIN32, WMI, WINSHELL

2011-03-11 Thread Ray Pasco
I'm using MSW DLL calls thru the 3 packages listed as well as ctypes calls on Win7 64-bit. I believe all the packages were developed in the XP days. Some calls just don't seem to work consistently on Win7. Specifically, I'm trying to reposition and resize application mai

3rd party python module with pyd picking up wrong dlls

2010-11-04 Thread Pix
this cause it to pick up the wrong dll which in turn causes the import error. If i renamed the dlls in XXX's dir then the import will work fine. So my question is, shouldn't the import be picking up the dlls in the module directory first before following the PATH in it's search order

Re: DLLs loading in interpreter but not with direct run on Windows

2010-04-26 Thread JTimoty
Sorry guys, the problem seems to be less general. Actually, the error is triggered when I try to import numpy before PyQt4. It imports without any problems after PyQt4. I still don't know what the problem actually is, but at least my scripts work. Thanks, Tim. -- http://mail.python.org/mailman

Re: DLLs loading in interpreter but not with direct run on Windows

2010-04-24 Thread TerryP
On Apr 23, 4:47 pm, JTimoty wrote: > Hi, > > I've got a weird problem, apparently related to the way python > searches for DLLs on Windows. > > I compiled PyQt4 (no errors) but scripts that use it fail with "DLL > load failed: Invalid access to memory location

Re: DLLs loading in interpreter but not with direct run on Windows

2010-04-24 Thread Michel Claveau - MVP
Hi! AMHA (IMO), it is PyQT4 who change the DLL loader... @+ -- MCI -- http://mail.python.org/mailman/listinfo/python-list

DLLs loading in interpreter but not with direct run on Windows

2010-04-23 Thread JTimoty
Hi, I've got a weird problem, apparently related to the way python searches for DLLs on Windows. I compiled PyQt4 (no errors) but scripts that use it fail with "DLL load failed: Invalid access to memory location." If I play with loading the modules inside the interpreter, I see n

Re: How do I install dlls and exes for libtidy and others?

2009-11-04 Thread Kevin Ar18
and/or dlls... but that is where the problem arises: * I do not know where to install the pre-compiled binaries. There are no instructions on this -- it's like everyone assumes I know what to do. * I tried copying the exe and/or dlls to Python, Python\Lib, Python\Dll * import libxml2, i

How do I install dlls and exes for libtidy and others?

2009-11-04 Thread Kevin Ar18
1. I already asked how to setup libxml2 and libxslt, but nobody answered how to... so if anyone knows I'm still having those problems. 2. I now can't get libtidy to work, which requires the same thing: I need to put some dlls and exes somewhere to make it work in Python. Thing i

Re: Ctypes module - looking for a way to dynamically call exported function from a set of dlls

2008-08-28 Thread dudeja . rajat
On Wed, Aug 27, 2008 at 5:20 AM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Tue, 26 Aug 2008 07:42:50 -0300, <[EMAIL PROTECTED]> escribi�: > >> Hi, >> >> I'm using the ctypes module to load my dlls. >> >> I have some 10 dlls the names

Re: Ctypes module - looking for a way to dynamically call exported function from a set of dlls

2008-08-26 Thread Gabriel Genellina
En Tue, 26 Aug 2008 07:42:50 -0300, <[EMAIL PROTECTED]> escribi�: Hi, I'm using the ctypes module to load my dlls. I have some 10 dlls the names of those are passed to a fucntion which then loads the passed dll. Now every dll has a getversion function. eg: A.dll, B.dll, C.dll a

Ctypes module - looking for a way to dynamically call exported function from a set of dlls

2008-08-26 Thread dudeja . rajat
Hi, I'm using the ctypes module to load my dlls. I have some 10 dlls the names of those are passed to a fucntion which then loads the passed dll. Now every dll has a getversion function. eg: A.dll, B.dll, C.dll are the dlls and GetVersion functions are as: A_getVersion(), B_getVe

Re: ctypes - unloading implicitly loaded dlls

2008-07-28 Thread pigmartian
make sense. I think I'd probably split the code into two or three processes though. Perhaps use http://pypi.python.org/pypi/processing to communicate between them. That should get you out of DLL Hell! (Don't load any of the DLLs before you start the worker processes off.) That

Re: ctypes - unloading implicitly loaded dlls

2008-07-28 Thread Nick Craig-Wood
ll, but I haven't found any way of doing that. Can anyone offer > my some suggestions? Or, am I S.O.L.? You could try loading C explicitly with ctypes.LoadLibrary() before loading A, then you'll have a handle to unload it before you load B. I think I'd probably split the c

ctypes - unloading implicitly loaded dlls

2008-07-27 Thread pigmartian
wants. Assuming my understanding of things is correct, then I believe what I need to do is to remove /path1/libC.dll from memory before I try loading libB.dll, but I haven't found any way of doing that. Can anyone offer my some suggestions? Or, am I S.O.L.? Notes: * the two sets o

ctypes - unloading implicitly loaded dlls

2008-07-27 Thread Scott Pigman
ings is correct, then I believe what I need to do is to remove /path1/libC.dll from memory before I try loading libB.dll, but I haven't found any way of doing that. Can anyone offer my some suggestions? Notes: * the two sets of dlls are supplied by a vendor for working with its COTS packages; I

Re: python, dlls, and multiple instances

2008-06-04 Thread Patrick Stinson
ahh, ok. Looks like my fundamental understanding of how dlls work was a little messed up. Thanks! On Sun, Jun 1, 2008 at 10:42 AM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> Is it a correct to assume that you can use multiple instances of >> python altoget

Re: python, dlls, and multiple instances

2008-06-01 Thread Martin v. Löwis
> Is it a correct to assume that you can use multiple instances of > python altogether if each is loaded from a separate dll? For instance, > if I write a couple of dll/so libs, and each has python statically > linked in, is it safe to assume that since dlls use their own address &

python, dlls, and multiple instances

2008-05-30 Thread Patrick Stinson
Is it a correct to assume that you can use multiple instances of python altogether if each is loaded from a separate dll? For instance, if I write a couple of dll/so libs, and each has python statically linked in, is it safe to assume that since dlls use their own address space then each dll would

Re: Linking debug C++ DLL with python dlls

2007-11-08 Thread Martin v. Lo
s and crashes. In particular, it *will* cause crashes if you pass FILE* opened by the debug CRT to PyRun_File and friends. That's an inherent limitation of Windows DLLs, and the way Microsoft set up global variables in the VC CRT. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Linking debug C++ DLL with python dlls

2007-11-08 Thread Mathieu Gontier
Hello, I often build Python on Windows. What I can say is it not so trivial to build debug libraries for Python: each debug library must have the postfix *_d.dll/.pyd. Another useful information. On Windows, a shared library is linked to our application though a associated file with the .lib e

Re: Linking debug C++ DLL with python dlls

2007-11-08 Thread brzrkr0
On Nov 8, 4:07 am, [EMAIL PROTECTED] wrote: > I tried to change the code above (just for fun) so in both cases i'll > use python25.lib and in debug compilation I got linker errors on > unresolved externals. seems like the debug version exports more > methods than the release version. I usually jus

Linking debug C++ DLL with python dlls

2007-11-08 Thread moshehaim1
Hi, I am working with C++ code that needs to be maintained both in debug and release versions. The environment is Windows 32 bit with MSVC8. I downloaded the python installation for Win32 and installed it. When, however, I tried to compile my DLLs in debug mode i got link errors specifying that

Re: Importing DLLs

2007-08-20 Thread Gabriel Genellina
En Wed, 15 Aug 2007 14:20:26 -0300, Corbitt, Kyle <[EMAIL PROTECTED]> escribi�: > I'm running Linux with Python 2.3. I have a C shared object file (*.so) > and I need to be able to call its functions from within Python. I have > found a couple of Python modules that allow me to do this (dl

Importing DLLs

2007-08-15 Thread Corbitt, Kyle
I'm running Linux with Python 2.3. I have a C shared object file (*.so) and I need to be able to call its functions from within Python. I have found a couple of Python modules that allow me to do this (dl, ctypes) but unfortunately I am only able to get them to return integers, even for functi

Re: Dlls

2007-02-18 Thread Steve Holden
Jason Ward wrote: > But in Assembler I can access any dll. Doesn't matter what language it > was written in. So this teaches us that Python isn't assembler language. > A dll contains machine code, so shouldn't any language be able to read > the functions. > Machine is the native language of a p

Re: Dlls

2007-02-18 Thread Mike C. Fletcher
Jason Ward wrote: > Hi. I am interested to know why python can't access DLL files directly. > It seems to me that because python can't access DLL's directly we have to > waste our time and write wrappers around libraries that have already > been written. > > So if the python developers were to i

Re: Dlls

2007-02-18 Thread Steve Holden
Jason Ward wrote: > Hi. I am interested to know why python can't access DLL files directly. > It seems to me that because python can't access DLL's directly we have to > waste our time and write wrappers around libraries that have already > been written. > > So if the python developers were to i

Dlls

2007-02-18 Thread Jason Ward
Hi. I am interested to know why python can't access DLL files directly. It seems to me that because python can't access DLL's directly we have to waste our time and write wrappers around libraries that have already been written. So if the python developers were to implement say this. import MYDL

Re: Missing .dlls when installing PyQt!? :(

2007-01-24 Thread Giovanni Bajo
On 24/01/2007 14.36, [EMAIL PROTECTED] wrote: > I must be doing something wrong here because I'm getting all these > missing .dll messages after installing PyQT. This is what I've done (no > step excluded): > > 1. Fresh installation of Python25 > 2. I run the PyQt-gpl-4.1.1-Py2.5-Qt4.2.2.exe file

Missing .dlls when installing PyQt!? :(

2007-01-24 Thread wd . jonsson
Hello! I must be doing something wrong here because I'm getting all these missing .dll messages after installing PyQT. This is what I've done (no step excluded): 1. Fresh installation of Python25 2. I run the PyQt-gpl-4.1.1-Py2.5-Qt4.2.2.exe file which should include SIP 3. I run the qt-win-opens

Re: Missing .dlls when installing PyQt!? :(

2007-01-24 Thread Phil Thompson
On Wednesday 24 January 2007 1:36 pm, [EMAIL PROTECTED] wrote: > Hello! > > I must be doing something wrong here because I'm getting all these > missing .dll messages after installing PyQT. This is what I've done (no > step excluded): > > 1. Fresh installation of Python25 > 2. I run the PyQt-gpl-4.

Re: 2.5a1 import of .dlls

2006-04-18 Thread Thomas Heller
[EMAIL PROTECTED] 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 >

2.5a1 import of .dlls

2006-04-18 Thread sven . nystrom
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):

Re: Windows installation - questions about DLLs

2005-07-01 Thread Larry Bates
Hi, > > I need to install python (2.3.5) on windows without the giving installer > program. > Do you know what dlls are needed? > I found python23.dll, but the other (msvcrt.dll,msvcrit.dll) seems not > be useful. > Is there other dll? Are msvcrt.dll and msvcrit.dll used by > somet

Re: Windows installation - questions about DLLs

2005-07-01 Thread kuoxin
rogram. > Do you know what dlls are needed? > I found python23.dll, but the other (msvcrt.dll,msvcrit.dll) seems not > be useful. > Is there other dll? Are msvcrt.dll and msvcrit.dll used by > something?(test/test___all__.py return no error whitout these two dlls). > &

Windows installation - questions about DLLs

2005-07-01 Thread Guillaume Hiron
Hi, I need to install python (2.3.5) on windows without the giving installer program. Do you know what dlls are needed? I found python23.dll, but the other (msvcrt.dll,msvcrit.dll) seems not be useful. Is there other dll? Are msvcrt.dll and msvcrit.dll used by something?(test/test___all__.py

Re: Windows Installer with Debug Dlls and Libs

2005-06-09 Thread Trent Mick
[DE wrote] > Thanks Trent. That's good news. > > Does ActivateState produce the debug package everytime they build a > python release ? Yes, we do. Cheers, Trent -- Trent Mick [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows Installer with Debug Dlls and Libs

2005-06-09 Thread DE
Thanks Trent. That's good news. Does ActivateState produce the debug package everytime they build a python release ? If this is a policy at ActivateState, I will feel myself on better grounds :) Ciao, DE -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows Installer with Debug Dlls and Libs

2005-06-09 Thread Trent Mick
[DE wrote] > Hello, > > I have a problem with python builds since some time. > > On windows, it is not a good idea to link your debug build to release > builds of libs and dlls. > > But python installer gives you only release builds. > > So I need to build

Windows Installer with Debug Dlls and Libs

2005-06-09 Thread DE
Hello, I have a problem with python builds since some time. On windows, it is not a good idea to link your debug build to release builds of libs and dlls. But python installer gives you only release builds. So I need to build python myself, no problem, but I have never managed to setup

Re: are DLLs needed to run glade interfaces in python with Windows?

2005-04-13 Thread stefan . eletzhofer
and > "libglade-2.0.0.dll" files. > > I think you only need to install theese as packages in Linux, but I'm > using Windows and I'm wondering if this is a must using it, or if > there are ways much cleaner that simply start dropping DLLs inside the > directory.

are DLLs needed to run glade interfaces in python with Windows?

2005-04-13 Thread Fernando
as packages in Linux, but I'm using Windows and I'm wondering if this is a must using it, or if there are ways much cleaner that simply start dropping DLLs inside the directory... Thanks. -- http://mail.python.org/mailman/listinfo/python-list