Using C and Python at the same time #96
felipetesc
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
What you describe is how all large game engines are written. The engine is written in C(++) and then a scripting language is embedded and used to write the game logic. Usually it's C#, Lua, Gdscript because they are better suited but the Python interpreter can be embedded in a C program. The other way of doing it (that isn't commonly done) is to write the main program in Python and then have it load C modules. Lookup Python ctypes, CFFI, etc. If you just want to use Python with better performance then look up Nuitka, MypyC and PyPy. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to use Python with C in a way that, for example, we can create some parts of the game, or the application, using c for better performance, and in some other parts, which aren't so 'heavy',with Python. How could I achieve that, that's, can we do that ? For instance, I'm thinking about using Python to draw the UI stuff, and for the rendering process of 3D objects to be programmed(rendered) using C code.
What changes would be needed to this project to connect your library to C source code? Thanks !
Beta Was this translation helpful? Give feedback.
All reactions