473,398 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Learning which modules were loaded

I am rolling up a distribution of a program I wrote. It uses matplotlib
with tkagg so the bundle is HUGE (47 MB, 14 MB after bz compression). Is
there any way to run the program, put it through all of its paces, and
then inspect which modules were loaded. I would like to gather these in
a list and delete any others that py2app and py2exe attempt to include.
Currently, these (or py2app, at least) use dependency graphing and
icnlude everything belonging to pylab, matplotlib, and numpy by default.
I don't want everything, I only want what my program needs to run. For
example, some modules are imported by functions (in Pmw, for example)
that never get called. I don't want to include these.

Thanks in advance for any help.

James
Jun 27 '08 #1
1 1133
James Stroud wrote:
I am rolling up a distribution of a program I wrote. It uses
matplotlib with tkagg so the bundle is HUGE (47 MB, 14 MB after bz
compression). Is there any way to run the program, put it through all
of its paces, and then inspect which modules were loaded. I would like
to gather these in a list and delete any others that py2app and py2exe
attempt to include. Currently, these (or py2app, at least) use
dependency graphing and icnlude everything belonging to pylab,
matplotlib, and numpy by default. I don't want everything, I only want
what my program needs to run. For example, some modules are imported
by functions (in Pmw, for example) that never get called. I don't want
to include these.

Thanks in advance for any help.

James
--
http://mail.python.org/mailman/listinfo/python-list
Import sys, then look at sys.modules. It's a dictionary that contains
all the imported modules, but I suspect you'll find that it's much
easier to let py2app and py2exe determine what's imported than it is to
go through sys.modules yourself.

Gary Herron

Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: saidev | last post by:
A quick question, I'm about to recompile PHP, last time I compiled it with alot of modules, thinking that this time I should not need that many. Is there any tool(s) that could run under the...
1
by: Remy Cool | last post by:
Hello, I've created an archive import class (with the help of importers.py from the python /demo/imputil dir) which imports packages and modules from a dictionary. So far so good. The problem...
4
by: Jelmer | last post by:
Hi I've been trying to create an addin similar to Find & Replace from Rick Fisher that looks thru your tables / queries / forms / modules etc.. for a reference to a string and optionally let's you...
7
by: Lauren Quantrell | last post by:
At running the risk of asking how big is too big... Is there a rule of thumb or a best practice that says I may have too many modules? I currently have a Access2K app with about 30 code modules,...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
26
by: mfasoccer | last post by:
I am sorry if this is an inappropriate place to put this post, if so please delete it. I am wondering about a few things. Do you guys recommend learning C as a second language, as someone who...
4
by: Frank | last post by:
Hi, I have the following weird behavior when I load modules: 8 Everything is fine. Traceback (most recent call last):
2
by: Marco | last post by:
Hi Is there a way to find out if a thread holds a handle to a loaded module? In detail: I have all IDs and handles of all running threads and loaded modules(dlls) of a process. No i want to...
1
by: bernhard.voigt | last post by:
Hey! I'm using ipython as my python shell and often run scripts with the magic command %run: In : %run script.py If modules are loaded within the script these are not reloaded when I rerun...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.