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
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
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)
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
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
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
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
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
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
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:
>
>
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
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:
>
>
>
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
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
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
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
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
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
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
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
Hi!
AMHA (IMO), it is PyQT4 who change the DLL loader...
@+
--
MCI
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
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
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
> 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
&
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
[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
>
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):
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
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).
>
&
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
[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
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
[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
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
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.
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
58 matches
Mail list logo