Skip to main content

Interact with SourceMod plug-ins

Project description

pysmx

pysmx is a Python package for parsing, executing, and simulating the environment of SourceMod plug-ins.

Quickstart

pip install pysmx
from smx import compile_plugin

plugin = compile_plugin('''
    public TwoPlusTwo() {
        return 2 + 2;
    }
    public float FiveDividedByTen() {
        return 5.0 / 10.0;
    }
    public String:Snakes() {
        new String:s[] = "hiss";
        return s;
    }
''')

print(plugin.runtime.call_function_by_name('TwoPlusTwo'))
# 4
print(plugin.runtime.call_function_by_name('FiveDividedByTen'))
# 0.5
print(plugin.runtime.call_function_by_name('Snakes'))
# 'hiss'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysmx-0.4.0.tar.gz (2.7 MB view hashes)

Uploaded Source

Built Distribution

pysmx-0.4.0-py3-none-any.whl (2.4 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page