Eclipse: connect to custom python interpreter with PyDev

浪子不回头ぞ 提交于 2019-12-06 00:31:22

I'm not 100% sure if I understand your core question but this should answer what I think you want to know:

You would not add your compiled game executable as an interpreter as it wouldn't be a python interpreter. Eclipse asks for a python interpreter.

If you want to run your code in a custom environment/PYTHONPATH with a (custom) installation of python, go to Window -> Preferences -> PyDev -> Interpreter - Python. That's where you can add your custom installation of Python as a preset and select its environment paths that are to be included in the PYTHONPATH for that interpreter preset (make sure you don't include the project's source paths themselves, Eclipse will add them when you run the project).

Once done, go to your project preferences and select the newly created interpreter preset from the list (PyDev - Interpreter/Grammar).

You will get code-completion as long as you use the PyDev editor(s) and have your PYTHONPATH environment correctly set-up.

Hope that helps.

You can debug an external python process by using the PyDev Remote debugging functionality and calling some pydev debugger code from your python program. This is documented on the PyDev website: http://pydev.org/manual_adv_remote_debugger.html#remote-debugger

This is my working code. Compile and do as bossi said and add you .exe as python interpreter in Eclipse and make sure to have the folder with your nessesary dll's in windows environment variabel PATH.

int wmain(int argc, wchar_t **argv)
{

    ScriptManager scriptManager; // This initialises Python. Python_Initialize()...

    int mainResult = Py_Main(argc, argv);


    return mainResult;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!