Library containing an object to name processes.
Project description
ProcessNamer
This library provides an object that is able to
-
Name a process
-
Stop a process from it's name
-
Give information about the current process
If you notice any errors, please notify me via: eliservices.server@gmail.com
Installation
pip install processnamer
Example use:
import sys
from time import sleep
#Import the lib:
from processnamer import processGame
#Create object:
prg = processGame()
#Display information (stdout or print will cause brokenpipe error):
sys.stderr.write("I am " + prg.prcname + ", and i have pid " + str(prg.pid) + "\n")
#Gather information: #Gets the name, but it can do this foe any pid
info = prg.getName(prg.pid) #Get info for pid of this process
#Display information:
sys.stderr.write("I am " + info + ", and i have pid " + str(prg.pid) + "\n")
if prg.prcname == "python": #If this is the original process
#Restart this as process imcool:
prg.nameStart("imcool",prg.script)
sleep(2)
prg.nameStop("imcool") #Stop the second process
else:
sleep(10) #Second process waits so that it can be stopped
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
processnamer-1.0.1.tar.gz
(3.6 kB
view details)
File details
Details for the file processnamer-1.0.1.tar.gz.
File metadata
- Download URL: processnamer-1.0.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da38390b54402670d2b7722bde7b2526b0e6193c139b6c37c0df0befb3c90f04
|
|
| MD5 |
d1873584fb3bcde8852be6c8b7e66b2e
|
|
| BLAKE2b-256 |
52c7d3be20ab78eda876dd2c653e30ee72e7d0f8edaee390cf23e7c86a3d9f64
|