I am playing with the python multiprocessing module and want to be able to display the name of the current executable process.
If I create my own class MyProcess, inheriting from multiprocessing. The process I can print the process name as follows.
from multiprocessing import Process class MyProcess(Process): def __init__(self): Process.__init__(self) def run(self):
However, if I create processes using the constructor of the Process class
from multiprocessing import Process def somefunc(): print Process.name
# 2 works, but # 1 doesn't. Is there a way I can print the name of the currently running process inside somefunc
?
source share