GameMaker (2.0 - 2.2.x)
Icon

GMPython

Meseta

You must be logged in to obtain assets

Description

Run Python in GM!

*Note: there appears to be a problem importing this package, here is a local copy of the extension that seems to work. I've filed a bug report with YYG: *

Why? Who knows! I was just wondering if it could be done, and apparently it can, but maybe not as well as you'd like. It's a standard embeddable CPython (Python 3.7, 32-bit) compiled into a DLL with a few helper functions to transfer variables between Python and GML. It's a faster and neater way to integrate Python into GM than running a compiled Python exe alongside a GM built game exe and then using networking or file accesses; but it comes with its own boatload of problems.

For one, while it's possible to include python modules (examples are included in the demos), not all of them work due to some specifics in how some python modules get installed. Multiprocessing doesn't quite work (python seems to be looking for a non-existent exe to do it), and Multithreading doesn't work either (I suspect CPython expects someone to actively trigger those threads, which the DLL is not doing).

But, it's still good for all manner of data processing tasks such as string parsing, XML, database connections, downloading files, etc. etc.

Provided for your entertainment. No further documentation is provided than the included demo scripts, and this page. Not recommended for production or serious game releases due to the highly experimental and weird nature of the thing.

Some functions: Set and get variables using python_set_double(), python_set_string(), python_set_bytes(), python_get_double(), python_get_string(), and python_get_bytes() functions. python_exists() can be used to check whether the variable exists in the global python scope; python_del() can be used to delete it.

python_execute_string() can be used to execute python code. You can use a string literal, or load a file and pass that instead.

End User Licence Agreement (EULA).

Age Rating: 4+

Version

GMS2 - Version 1.0.7. Published July 7, 2019

Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait