Getting a list of all modules

Roy Smith roy at panix.com
Thu Jul 31 07:55:38 EDT 2014


In article <53da1d5a$0$29974$c3e8da3$5496439d at news.astraweb.com>,
 Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:

> I'm working on tab completion for module names. I have some alpha-quality 
> code working, so if I hit TAB after typing "import ma" I get this:
> 
> 
> py> import ma
> macpath      macurl2path  mailbox      mailcap      mangle       
> markupbase   math

That's kind of neat.  What do you do if the same name appears multiple 
places in your path?  It would be useful to call this out.  More than 
once, I've done "import x" and gotten a different x than I expected.  
Those kinds of problems can be tricky to debug.



More information about the Python-list mailing list