1

i am new to python and am trying to call a c++ function from python, I cam across this answer from Florian Bösch and found it really helpful, i did everything as in the link but i have a small problem which really surprised me, when i run the fooWrapper.py from command prompt it displays the result "hello" but when i run the program from idle by clicking run as module the python shell opens and displays nothing, only action is the cursor moves down as when you press enter. Is this normal or is this a problem???

I use python 2.7.3(32bits),with windows 7 and MInGW complier.

Community
  • 1
  • 1

1 Answers1

1

The problem is that IDLE redirects standard input and output, but your C++ function writes to the original standard output and thus IDLE will not show it. If you launch IDLE from a terminal you will see the C++'s output in the terminal.

It's a problem of IDLE, and I doubt that you can do something about it.

If you want to develop something bigger than a really small script you ought to use a different IDE.

Bakuriu
  • 98,325
  • 22
  • 197
  • 231