Skip to main content

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


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.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

processnamer-1.0.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file processnamer-1.0.0.tar.gz.

File metadata

  • Download URL: processnamer-1.0.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for processnamer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7fa43b337209e84d8c89bfcd1dd149394fbfc5320becab1a42a6c8dbe7a13c77
MD5 7ac3ff0b1a949dee43aca2ad35abfb4c
BLAKE2b-256 7db09f5d00ddc5f9b273851d2ad17e8b914df972642b7604080339d20d01016a

See more details on using hashes here.

File details

Details for the file processnamer-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: processnamer-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for processnamer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 358c1cf6e4972803915a32bbcdf9a724a84412eda96e5c21c80abeb32971b010
MD5 769b542dee761c90b8bce83e796a8bf7
BLAKE2b-256 eefbf4e9f56d8724b867e1d2899429fd0b53ff72e568c749dd63719f77af2b1d

See more details on using hashes here.

Supported by

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