setproctitle (A Python module to customize the process title)

PyAV issues#215 で使っているのが目に留まって。

最初ウィンドウタイトルを変更するものかと誤解しちゃったがこれは「プロセス名」を変えるヤツ。インストールしてみていきなり C 拡張をビルドし始めて、なんでウィンドウタイトル変更ごときに C が必要なん、と思ったが、そういうことならわかる。

Unix variant で使うのは楽:

Windows ではタスクマネージャで参照出来る情報を書き換える術はなく、Named Object で実現してるんですと。これを見るには Process Explorer などで。Process Explorer はバージョンによってかなりインターフェイス違ってるけどアタシが手持ちのだとこうなる:

一応公式の説明:

The setproctitle module allows a process to change its title (as displayed by system tools such as ps and top).

Changing the title is mostly useful in multi-process systems, for example when a master process is forked: changing the children’s title allows to identify the task each process is busy with. The technique is used by PostgreSQL and the OpenSSH Server for example.

The procedure is hardly portable across different systems. PostgreSQL provides a good multi-platform implementation: this module is a Python wrapper around PostgreSQL code.

ここで全部言いたいことは書かれてるんで、繰り返すのもなんだけれど、「(プロセスだらけの)干し草の山から針(=オレ)を探す」のに役立つ、てわけだ。名前で自己主張することによって。