473,385 Members | 1,342 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,385 software developers and data experts.

Module list generation

Is this the best/simplest way to generate a module list?

python -c 'from pydoc import help; help("modules")'

Thanks,
Doug
Jul 18 '05 #1
2 1478
Doug Kearns wrote:
Is this the best/simplest way to generate a module list?

python -c 'from pydoc import help; help("modules")'

Thanks,
Doug

I am not sure if this is what you want, but how about:

For python 2.4, try:
python -c "import sys; print sorted(sys.modules)"

For earlier pythons, use:
python -c "import sys; nms = sys.modules.keys(); nms.sort(); print nms"
or:
python -c "import sys; print sys.modules.keys()"
if you don't care about order.

--Scott David Daniels
Sc***********@Acm.Org
Jul 18 '05 #2
In article <41********@nntp0.pdx.net>, Scott David Daniels wrote:
Doug Kearns wrote:
Is this the best/simplest way to generate a module list?

python -c 'from pydoc import help; help("modules")'

Thanks,
Doug I am not sure if this is what you want, but how about:


I'm updating the zsh completion function for python and need to
generate a list of modules for completing the new '-m' option.
For python 2.4, try:
python -c "import sys; print sorted(sys.modules)"


I don't know python, but as I understand it, this only lists _loaded_
modules.

Thanks,
Doug
Jul 18 '05 #3

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

Similar topics

3
by: Fernando Rodriguez | last post by:
Hi, How can I get the list of all the functions defined in the current module?
8
by: Bo Peng | last post by:
Dear list, I am writing a Python extension module that needs a way to expose pieces of a big C array to python. Currently, I am using NumPy like the following: PyObject* res =...
5
by: gg | last post by:
I am getting the following compilation errors with the following program. My compiler is aCC 03.27 on HP-UX11 - #include <iostream> using namespace std; #include <list> #include <memory>...
39
by: n00m | last post by:
Given a list of N arbitrarily permutated integers from set {1..N}. Need to find the ordering numbers of each integer in the LONGEST increasing sequence to which this number belongs. Sample: ...
2
by: Oenone | last post by:
I'm upgrading a DLL from VB6 to VB.NET. The DLL gets called from an ASP.NET web application. In the VB6 code there is a module-level object which stores the context about what the user is doing...
1
by: Ryan Ginstrom | last post by:
I have been maintaining a body of documentation in plain HTML files. I would now like to automate the generation of the HTML files. Maintaining the HTML files now is tedious and error prone,...
10
by: Ben Finney | last post by:
Howdy all, Question: I have Python modules named without '.py' as the extension, and I'd like to be able to import them. How can I do that? Background: On Unix, I write programs intended to...
1
by: stuffduff | last post by:
Hi, I have a python extension that works fine while it is running, but when I exit python I get this error: GNU gdb Red Hat Linux (6.5-15.fc6rh) Copyright (C) 2006 Free Software Foundation,...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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...

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.