Home  >  Article  >  Backend Development  >  Detailed explanation of Python custom process name

Detailed explanation of Python custom process name

高洛峰
高洛峰Original
2017-03-23 15:26:063457browse

Under normal circumstances, we directly start the python program and use ps to view it. The displayed The result is pyton xxx.py, and the web application uses netstat or ss to view it as python

It’s too impersonal, too general, and very ordinary. So there is a group of people who don’t. Satisfied with the fixed name, forging ahead (you are curious, maybe it is just pretending), and showing off your personality, so Google found a very ( ) third-party library—

set

proctitle .

Installation

Method:

1. 源代码编译安装
git clone https://github.com/dvarrazzo/py-setproctitle.git
cd py-setproctitle
python setup.py build
python setup.py install2. pip install setproctitle
Usage:

#coding:utf8import setproctitle
setproctitle.setproctitle("进程别名")

The effect is as follows:

The above is the detailed content of Detailed explanation of Python custom process name. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn