Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url:sourceforge': 0.03; 'win32': 0.03; 'params': 0.07; 'python': 0.09; 'mutable': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; 'subject:python': 0.11; 'assume': 0.11; 'extensions': 0.13; 'library': 0.15; 'dec': 0.15; 'interfaces': 0.15; 'passing': 0.15; 'bitbucket': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:accessing': 0.16; 'subject:which': 0.16; 'url:pywin32': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'mostly': 0.20; 'parameters': 0.20; 'subject:) ': 0.20; 'ctypes': 0.22; 'object.': 0.22; 'defined': 0.22; 'monday,': 0.23; 'pass': 0.25; 'looks': 0.26; 'easiest': 0.27; "doesn't": 0.28; 'header:X-Complaints-To:1': 0.28; 'array': 0.29; 'objects': 0.29; 'install': 0.29; 'knows': 0.30; 'url:source': 0.30; 'function': 0.30; 'december': 0.32; 'url:home': 0.33; 'handle': 0.33; 'to:addr:python-list': 0.33; '(with': 0.33; 'likely': 0.33; 'point.': 0.33; 'received:org': 0.36; 'but': 0.36; 'method': 0.36; 'useful': 0.36; 'too': 0.36; 'charset:us-ascii': 0.36; 'subject: (': 0.36; 'itself': 0.37; 'uses': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'between': 0.63; 'more': 0.63; 'believe': 0.69; 'direct': 0.69; 'hoping': 0.72; 'receiver': 0.84; 'dennis': 0.91; 'received:108': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: accessing an OLE Automation (IDispatch) server from python which requires the use of "out params" Date: Mon, 10 Dec 2012 18:39:00 -0500 Organization: > Bestiaria Support Staff < References: <38a14001-82b6-4a91-b3ad-2cb5c8ee580d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-73-117-170.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1355182737 news.xs4all.nl 6856 [2001:888:2000:d::a6]:37522 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34582 On Mon, 10 Dec 2012 13:39:00 -0800 (PST), bitbucket declaimed the following in gmane.comp.python.general: > On Monday, December 10, 2012 3:58:33 PM UTC-5, Terry Reedy wrote: > > I believe the easiest way to do that is to install the pywin extensions > > > > http://sourceforge.net/projects/pywin32/?source=directory > > > > I assume it can handle out params. > > That definitely looks like a good starting point. Just hoping someone knows whether or not it'll support the out params before I spend too much time digging into it. Well, Python itself doesn't handle "out" parameters... The win32 extensions mostly access the defined Win32 API... May not be that useful for ad-hoc interfaces. The ctypes library may be a more direct means -- it interfaces between Python objects (with specific attributes/properties) used as data types and the C-language calling conventions... "ctypes exports the byref() function which is used to pass parameters by reference" PowerShell likely uses the same method you'd need in Python -- passing a mutable object (an array in PS), but the receiver would need to be expecting such an object. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/