Does anyone know an easy way to record the modules that a Python program is loading - the profiler records the Python ones but not extension modules. What I'm interested is the possibility of producing 'MiniPy's that contain only the stuff needed to run a given application. Thanks.