Finding the name of the program from which a Python module is running can be trickier than it would seem at first, so lets make it damned easy. This works under pycharm, pytest, pytest-docrunner, ...
Set 'Application Name' when monitoring applications with 'db2 list application' so they not appear as 'python'. USR1 python 27172 192.168.12.132.51577.131212110440 USR1DB 1 setting programName = PID ...