Pythonwin embedded in another program...

Chris Christopher.Cox at honeywell.com
Thu Jun 21 16:42:29 EDT 2001


My company is trying to do some testing on a particular piece of
hardware to be used on aircraft engines.  In order to test this unit,
a monitor program was built with a version of pythonwin embedded in it
(using python version 1.5).  The connection between our test unit and
our PC (running WinNT4.0 SP6) is a serial port.  I've written some
scripts using the serial i/o module which work under a normal instance
of pythonwin.  However, when I try to run those same scripts under our
own software, I get an error.  One of the developers of our monitor
mentioned something about using a debug(???) version of python (I'm
not intimately familiar with our monitor so I may be off a bit there).
 After building elapsedTimer_d.pyd and sio_d.pyd I manually made
reference to them in the registry where the other module references
are.  Upon trying to import from the interactive prompt in our monitor
I get the following error.
>>> from Serial import Serial
Traceback (innermost last):
  File "<interactive input>", line 1, in ?
  File "C:\Python\Serial\Serial.py", line 38, in ?
  File "C:\Python\Serial\MsTimer.py", line 5, in ?
ImportError: DLL load failed: One or more arguments are invalid

This may have to do with our monitor not working properly, and
understandably no one will be able to help me with that particular
portion, but are there any suggestions on what to try?  As I've said
before, this import statement works fine in pythonwin, and the serial
module works flawlessly.  If I can't get our monitor to run the
scripts without error, I was thinking that as an alternative, I can
somehow open pythonwin from within a script running on our monitor and
doing what I need to do in there, then return to the original script. 
If I need to go this route, are there any suggestions to accomplish
this (in as simple a manner as possible since our tools need to go
through a rather rigorous verification process as mandated by the
FAA)?  If this is possible, what about passing arguments from the main
script to a separate script running in pythonwin and then returning
some value?

I apologize for the length of this post and for the semi-off-topic
content.  I'm only 2 months into writing with python and reading this
NG has been extremely helpful in the knowledge I've gained so far so I
thought I'd try the obviously capable python community at large. 
Thanks for any help that can be offered.

Chris
Christopher.Cox at honeywell.com



More information about the Python-list mailing list