I compiled a simple hello world C module for Python and it works correctly in everything I've tried but IDLE. Here's what I type to test it:
>>> import hello
>>> hello.say_hello('Justin')
I have tried this using Python from the command prompt(I'm using Windows), in Eclipse's PyDev, and with PieDream and they all print out Hello Justin!. However, in IDLE it doesn't print anything - it just gives me the prompt.
The module and setup.py I'm using are from this page. I think that the problem is with the compiler. I'm using MinGW which I set as the compiler for distutils in a .cfg file. I build the module from the command prompt with:
python setup.py build
and get
running build
running build_ext
building 'hello' extension
creating build
creating build\temp.win32-2.6
creating build\temp.win32-2.6\Release
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python26\include -IC:\Python26\PC -c hellomodule.c -o build\temp.win32-2.6\Release\hellomodule.o
writing build\temp.win32-2.6\Release\hello.def
creating build\lib.win32-2.6
C:\MinGW\bin\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.6\Release\hellomodule.o build\temp.win32-2.6\Release\hello.def -LC:\Python26\libs -LC:Python26\PCbuild -lpython26 -lmsvcr90 -o build\lib.win32-2.6\hello.pyd
I'm thinking that it might have something to do with the -mno-cygwin part in there, but I'm not sure.
Any ideas or suggestions as to why this module won't work in IDLE? Should I be using a different compiler?