Skip to main content

Kills python + all subprocesses, restarts with the same args, Windows only, works with pyinstaller

Project description

Kills python + all subprocesses, restarts with the same args, Windows only, works with pyinstaller

pip install babyonemoretime

from babyonemoretime import restart_everything

from time import sleep

import subprocess

import sys



sleep(4)

if sys.argv[1] == "n":

    subprocess.Popen("notepad.exe")

else:

    subprocess.Popen("word.exe")



sleep(4)

restart_everything(pyfile=__file__, sysarv=sys.argv, restart=False)  # kills everything

restart_everything(pyfile=__file__, sysarv=sys.argv, restart=True) # kills everything and restarts









# python.exe resa.py n

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

babyonemoretime-0.10.tar.gz (20.8 kB view hashes)

Uploaded Source

Built Distribution

babyonemoretime-0.10-py3-none-any.whl (21.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page