https://github.com/they4kman/pysmx
Python package to interact with SourceMod plug-ins
https://github.com/they4kman/pysmx
python sourcemod
Last synced: 10 months ago
JSON representation
Python package to interact with SourceMod plug-ins
- Host: GitHub
- URL: https://github.com/they4kman/pysmx
- Owner: theY4Kman
- Created: 2012-07-12T07:33:27.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2023-03-14T17:40:56.000Z (almost 3 years ago)
- Last Synced: 2025-03-25T04:51:14.429Z (10 months ago)
- Topics: python, sourcemod
- Language: SourcePawn
- Homepage: https://pypi.org/project/pysmx
- Size: 3.6 MB
- Stars: 19
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# pysmx
**pysmx** is a Python package for parsing, executing, and simulating the environment of SourceMod plug-ins.
## Quickstart
```shell
pip install pysmx
```
```python
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'
```