Last active
December 26, 2024 20:25
-
-
Save jikanter/4764cfc3e4c6edd9812eee893126703a to your computer and use it in GitHub Desktop.
[Execute Python From Lua] #lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function runPythonCode(scriptCode) | |
| --local output, status, type, rc = hs.execute("PATH=/usr/local/bin:${PATH}; python -c 'import sys; sys.stdout.write(str(123))'") | |
| local output, status, type, rc = hs.execute("PATH=/usr/local/bin:${PATH}; python -c '" .. scriptCode .. "'") | |
| local response = { | |
| output = output, | |
| status = status, | |
| type = type, | |
| rc = rc | |
| } | |
| return response | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment