Using wxPython in Eeschema

Hi,
I’m trying to build my own widget for a component using wxPython but eeschema always crashes. I am calling wxPython using the Python-C++ API, and using a text file as a tester, I see that the program never jumps out of the API loop. Would there be a specific reason for this and how could I fix it?

Generally eeschema does not support python scripting right now (it is planned for v6).
That’s not to say that some hacking can’t be done but it will always be fragile and break in all sort of ways. But if you can make it work for you, sometimes it’s enough.

If you share your code you can get more specific pointers, it’s hard to say without knowing what exactly your code is doing and what exactly crashes. Regarding never getting out of the API loop one potential issue may be that you are creating your own instance of wxApp which will prevent the program to exit normally. Unfortunately there is currently no way to get the actual wxApp from main process (see https://github.com/wxWidgets/Phoenix/issues/1126 which is fixed but not picked up by linux repos yet).

1 Like

Thank you! I am creating my own instance of wxApp. That would definitely make sense as to why it keeps crashing. When would v6 be out?
Cheers!

There is no definite date but if history is any indication, probably in ~2 years.

You can keep https://gitlab.com/kicad/code/kicad/issues/2077 on track but, when this ticket be closed, the Eeschema Python integration will be only available at Nightly builds.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.