Reputation: 573
Say for instance I have a python web app in flask/django that makes use of tensorflow and nltk libraries.
Is it possible for another program running on the same computer to somehow inspect the python program and determine what libraries it is using? E.g. somehow inspect the memory space and determine it has been using nltk and tensorflow libraries?
Upvotes: 1
Views: 78
Reputation: 181
From the Python docs:
modulefinder — Find modules used by a script
This module provides a ModuleFinder class that can be used to determine the set of modules imported by a script. modulefinder.py can also be run as a script, giving the filename of a Python script as its argument, after which a report of the imported modules will be printed.
You will need to know the name of the script, however, for the modulefinder to work.
More info on the library is here: modulefinder docs
Upvotes: 1