Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.comp.lang.python > #4543

Re: [Python-de] DLL-Funktion von Python aus nutzen

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From "Diez B. Roggisch" <deets@web.de>
Newsgroups de.comp.lang.python
Subject Re: [Python-de] DLL-Funktion von Python aus nutzen
Date Mon, 26 Sep 2016 00:07:40 +0200
Lines 47
Message-ID <mailman.2.1474842036.2302.python-de@python.org> (permalink)
References <e4qq5lF64t1U1@mid.individual.net> <D031F784-2A8A-4EA3-9523-508B034BD2A7@web.de>
Mime-Version 1.0 (1.0)
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de cbXGfnCSGfcnSMWwJy5nSAXSXoVq6KMo7zah18DVn93g==
Return-Path <deets@web.de>
X-Original-To python-de@python.org
Delivered-To python-de@mail.python.org
X-Mailer iPhone Mail (13G36)
In-Reply-To <e4qq5lF64t1U1@mid.individual.net>
X-Provags-ID V03:K0:9YvoyCaGtoktWd/zMQ+owLVmB2A13zbD2q9qoknOw/L6ZWlUqG/ crtRCfSrNKLk6pOwo32WpbbYdGr9fjOnpoalQB4XM3s4EMdg3DR9sfSk77MiTw7No2u1ePA uYTCn4kt4qntBx5RVQkCXX391L4kpAW16WXH1Tb0WTq8NLpA9mFAYqiHgwkawXbegztEGbk No+JKGehxholXUYVVY17g==
X-UI-Out-Filterresults notjunk:1;V01:K0:PUUUJC49Z2Y=:9UfhmGjsiPg3g+GrieAKnr ZX6q0dxIgi3dtVX6M6axajVtWWSBod9urPE0WIwQwZeAJBwUcZn4syeYLSAEWs+m3rgtwQVCz KBgmwxljL8V9NWDTClslUtDatJ4Q2zjO7L0zWAuPzDc4s8g12D5Xr2Al2BPeaImuRspYC0Ec3 DteRFiovAqaIO1i1QizBLgZQZD470N8jdE+/QfY8yPbSAMJQHkNVxgEXJCuYpx3rmfDzi1IsE sQqhsikNoj1T8Yh08HUP9bWnruDOSw2rOFMMVH/0/gLlR9oWmlOLDauv+iqLJ7z0bzZkMBxjP iBcHc3vwQNpw4T9kP03P48ZzLQaMyGdDpXMQOUWdusO3jhxs4MJCBn/HSbbZ3lJsttHe93mwD oLMFD0RIMDPQTXB5jgK3QQqm5nyBxIGZo4eiSo8H0vEphMJMMMo2sDmm4b0DNBZSwLvospOTX EMJh+CinOgEEkIXnuGmAsDhxEnPskBMRbFjKAPmMs4CbBuvQ+tffh2y7g/pPbqIoy7KCRGq1j Q3qyGYlFyCbWAuLVoy/BdzXcRK5dDdgt8MISrJKAPn2f1B1lw1DR7FQk7Y6iVEBAZtUSPolA7 GZI+aS8tUwPz1frwQMuRDFVc/6tM3hujjkFAU6B0lLMDaKPmVl4jdHbijWcEXYQvF8yvV5DSu OLofSj1jzWfVsNWhBcraNnoYyDIa+sG1U8/DKZVg7d3NhD7uqOXNlcIrVXETvwtCDpfoG1EUX jXX0yAmvNCszauSe5JXzk5PfIct/Uz8qLTUS3EZ+o+wisB8wGPLaI9JZ2x5R/240Z+FpL/JRD hK6KZRo
X-BeenThere python-de@python.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Die Deutsche Python Mailingliste <python-de.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-de>, <mailto:python-de-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-de/>
List-Post <mailto:python-de@python.org>
List-Help <mailto:python-de-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-de>, <mailto:python-de-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <D031F784-2A8A-4EA3-9523-508B034BD2A7@web.de>
X-Mailman-Original-References <e4qq5lF64t1U1@mid.individual.net>
Xref csiph.com de.comp.lang.python:4543

Show key headers only | View raw


Wieso sollte da magisch eine Liste auftauchen? 

C kennt keine Listen. Jedenfalls nicht so. Die Funktion erwartet, bekommt & befüllt ein Character Array. Das kannst du nun selbst in eine Liste verwandeln. Oder einfach direkt drüber iterieren. 

Diez 



Mobile Mail. Excuse brevity. 


> Am 25.09.2016 um 22:25 schrieb Hans-Georg Joepgen <test@joepgen.com>:
> 
> Es soll die Funktion HeEnum in der DLL 'he2325u.dll' von Henrik Haftmann aus einem Pythonscript genutzt werden. Auszug aus he2325u.h:
> 
> #define HE_NUM_MAX 256
> ...
> FUNC(void) HeEnum(char List[HE_NUM_MAX]);
> 
> Das Script (Python 3.5.2, Windows 10 V1607/64):
> 
> import ctypes
> dll = ctypes.WinDLL ('he2325u.dll')
> liste = ctypes.create_string_buffer(256)
> dll.HeEnum (liste)
> print (liste.value)
> 
> Statt der erwarteten Liste wird ein Block mit folgendem Start ausgegeben:
> 
> b'\xfe\xfe\xff\xff\xff\xff\xff\xff\...
> 
> Irgendwo muss ein dummer Fehler stecken. Sieht den jemand?
> 
> Nebenbei: Es geht um das Auslesen des Uni-Trend DMM UT61B per USB-Interface. Das Programm dmm von Henrik Haftmann schafft
> das über he2325u.dll sehr schön; Dll und DMM sind also in Ordnung.
> 
> Gruß -- Joe
> _______________________________________________
> python-de maillist  -  python-de@python.org
> https://mail.python.org/mailman/listinfo/python-de
> 

Back to de.comp.lang.python | Previous | NextPrevious in thread | Find similar


Thread

DLL-Funktion von Python aus nutzen Hans-Georg Joepgen <test@joepgen.com> - 2016-09-25 22:25 +0200
  Re: [Python-de] DLL-Funktion von Python aus nutzen "Diez B. Roggisch" <deets@web.de> - 2016-09-26 00:07 +0200

csiph-web