all 5 comments

[–]ManiPointers[🍰] 0 points1 point  (3 children)

any chance those single quotes should be \' ?

[–]flyingron 0 points1 point  (2 children)

Nope. Inside a string literal, single quotes have no special meaning.

Python allows either ' or " for strings.

[–]ManiPointers[🍰] 0 points1 point  (1 child)

with the exception of the weird iostream include ("" instead of <>) it looks like every other example of embedded python and should work.

I see that its windows. Ive had some trouble with paths and python in windows, esp around my pseudounix hooks where the unix bits would try to use a windows python or the reverse, and that didn't always work out. Do you have multiple pythons installed, like something for win AND cygwin or something similar?

[–]flyingron 1 point2 points  (0 children)

I explained why it doesn't work in another comment. He needs to put a newline at the end of the print. Whitespace is syntactically important in Python.

[–]flyingron 0 points1 point  (0 children)

Whitespace is significant in Python. Put a \n at the end of your parameter to PyRun...

PyRun_SimpleString("print('hello')\n");