Download goex/docker/mysql_docker/python_executor.py from rsc-inv/GoEx: direct link, hf CLI and curl.
- Browser
- Download file 348 Bytes
-
https://huggingface.co/spaces/rsc-inv/GoEx/resolve/main/goex/docker/mysql_docker/python_executor.py
- Command line
-
hf download hf://spaces/rsc-inv/GoEx/goex/docker/mysql_docker/python_executor.py
-
curl -L -o python_executor.py https://huggingface.co/spaces/rsc-inv/GoEx/resolve/main/goex/docker/mysql_docker/python_executor.py
348 Bytes
| from io import StringIO | |
| from contextlib import redirect_stdout | |
| import sys | |
| import os | |
| def code_execute(): | |
| f = StringIO() | |
| code = os.environ['CODE'] | |
| with redirect_stdout(f): | |
| exec(code, globals()) | |
| exec_stdout = f.getvalue() | |
| print(exec_stdout) | |
| return exec_stdout | |
| if __name__ == "__main__": | |
| globals()[sys.argv[1]]() | |