[python-win32] Dll

Magnus Lyckå magnus at thinkware.se
Thu Jun 19 14:32:58 EDT 2003


At 03:33 2003-06-19 -0700, Anthony Catalfo wrote:
>Can a Dll comunicate with a python script? ie change a
>variable in the script?

Nothing external can really change a variable in an
independently running Python script at its own bidding.
Not in a nice way at least! :) The Python script can ask
a DLL about a value, or a DLL can run a Python script,
and thus control it.

The best way to access a DLL from Python may be to use
the ctypes library. I'm sure you can find that with google.

For a DLL to access Python code, I suppose you need
to embed the Python interpreter in the DLL. That is
described in the Python manuals. (Embedding and Extending)

I'm still a little puzzled over your formulation though.
Can you explain a little more what it is you want to do?


--
Magnus Lycka (It's really Lyckå), magnus at thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The Agile Programming Language 




More information about the Python-win32 mailing list