2

So, I'm interested in communicating between a C program and a Python program so that I can neatly send tasks and data between the two.

I figured I'd go ahead and start with this guide. In this guide I have a C file with contents outlined in the example in the link right above the "Building and Installing Extensions" title and the python code from right under it. After I run the python setup.py install command I try to import the created module through

>>>import helloworld                                                                                                   
ImportError: DLL load failed: %1 is not a valid Win32 application.  

So I suppose the issue is that the extension is 32-bit while my Python installation is 64-bit? The python I'm using is

Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] on win32

All help appreciated!

1
  • I think you have answered your own question. Compile your DLL as 64-bit. Commented Jun 6, 2018 at 23:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.