Datasets:
Download Version4/render-main/restart.py from ysn-rfd/text-dataset-tiny-code-script-py-format: direct link, hf CLI and curl.
- Browser
- Download file 284 Bytes
-
https://huggingface.co/datasets/ysn-rfd/text-dataset-tiny-code-script-py-format/resolve/main/Version4/render-main/restart.py
- Command line
-
hf download hf://datasets/ysn-rfd/text-dataset-tiny-code-script-py-format/Version4/render-main/restart.py
-
curl -L -o restart.py https://huggingface.co/datasets/ysn-rfd/text-dataset-tiny-code-script-py-format/resolve/main/Version4/render-main/restart.py
284 Bytes
| # restart.py | |
| import os | |
| import sys | |
| import subprocess | |
| import logging | |
| logger = logging.getLogger(__name__) | |
| def restart_bot(): | |
| """ریستارت کردن ربات""" | |
| logger.info("Restarting bot...") | |
| python = sys.executable | |
| os.execl(python, python, *sys.argv) |