Restarts process (Windows only)
Tested against Windows / Python 3.11 / Anaconda
pip install restartprocwithvars
from restartprocwithvars import (
set_console_ctrl_handler,
newstartwhenctrlc,
disable_restart_proc,
)
from time import sleep
from functools import partial
import sys
disable_restart_proc(
"ctrl+alt+w",
)
set_console_ctrl_handler(
returncode=1,
func=partial(
newstartwhenctrlc,
sleeptime=30,
sleep_before_restart=5,
sleep_after_exit=5,
pythonexe=sys.executable,
),
)
while True:
sleep(1)
print("test")
sleep(10)
# def _switch_restart_proc():
# """
# Toggle the value of config.restart_proc and print the updated status.
# """
# def disable_restart_proc(disable_shortcut):
# """
# Function to disable the restart process with a specified shortcut.
# :param disable_shortcut: str - The shortcut used to disable the restart process.
# :return: None
# """
# def newstartwhenctrlc(*args, **kwargs):
# """
# A function to handle the behavior when Ctrl+C is pressed. It checks if a process needs to be restarted, then generates a batch file for the restart process with necessary environment variables and commands. Finally, it starts the batch file in a new subprocess and exits the current process.
# """
Metadata
Release files for restartprocwithvars 0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| restartprocwithvars-0.10.tar.gz | 4.5 kB | Without provenance | Details for restartprocwithvars-0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| restartprocwithvars-0.10-py3-none-any.whl | Python 3 | none | any | Details for restartprocwithvars-0.10-py3-none-any.whl |
Total release size: 11.0 kB
Release files / restartprocwithvars-0.10.tar.gz
| Download URL | restartprocwithvars-0.10.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a354640933c0af4ecd1d88dbff13830809a685557be8a730186112df8b6a0c39
|
|
BLAKE2b-256 checksum How to use checksums |
0a192b8a05d2e6da00e3c95884080e9aebadaa8dd724376f979c7f3a888f79e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / restartprocwithvars-0.10-py3-none-any.whl
| Download URL | restartprocwithvars-0.10-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1b8c7d35b4ddd40955e42c0ed391815b5c5243114cc5813237c371ba44375de
|
|
BLAKE2b-256 checksum How to use checksums |
c5fcc3041341bd98f99894531304ef0243170f1f880cf590449ec7b338e2bc0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for restartprocwithvars 0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.