Python API

q3py acts as a C extension module to the embedded Python. This allows the Python module to call back into Quake 3 and to configure q3py.

q3py.set_vmmain(callback)

New in version 0.0.1.

Sets the vmMain callable that q3py invokes when being called by Quake 3.

Parameters:callback (callable) – The Python callable to use
Raises:TypeError: if callback is not a callable()
q3py.syscall(num[, args])

New in version 0.0.1.

Invokes a Quake 3 syscall.

Parameters:
  • num (int) – The number of the syscall
  • args (int) – The arguments for the syscall
Returns:

The result of the syscall

Return type:

int

q3py.__version__

New in version 0.0.1.

Contains the version of q3py as a read-only string of the form MAJOR.MINOR.PATCH, e.g. “0.0.1”.

q3py._C_API

New in version 0.0.1.

Contains a read-only PyCapsule of q3py’s C API.