Re: Discover all non-standard library modules imported by a script

2016-09-16 Thread Malcolm Greene
Thanks for your suggestions Chris and Terry. The answer I was looking for is the modulefinder module which is part of the standard lib. Works like a charm! Quote: This module provides a ModuleFinder class that can be used to determine the set of modules imported by a script. modulefinder.py can

Re: Discover all non-standard library modules imported by a script

2016-09-16 Thread Terry Reedy
On 9/16/2016 7:29 AM, Malcolm Greene wrote: Looking for suggestions on how, given a main script, discover all the non-standard library modules imported across all modules, eg. the modules that other modules import, etc. I'm not looking to discover dynamic imports or other edge cases, just

Re: Discover all non-standard library modules imported by a script

2016-09-16 Thread Chris Angelico
On Fri, Sep 16, 2016 at 9:29 PM, Malcolm Greene <pyt...@bdurham.com> wrote: > Looking for suggestions on how, given a main script, discover all the > non-standard library modules imported across all modules, eg. the > modules that other modules import, etc. I'm not looking to dis

Discover all non-standard library modules imported by a script

2016-09-16 Thread Malcolm Greene
Looking for suggestions on how, given a main script, discover all the non-standard library modules imported across all modules, eg. the modules that other modules import, etc. I'm not looking to discover dynamic imports or other edge cases, just the list modules loaded via "import "