[CentralOH] Browsing Python Modules

jep200404 at columbus.rr.com jep200404 at columbus.rr.com
Tue Jul 26 05:58:21 CEST 2011


On Wed, 20 Jul 2011 08:12:19 -0400, Mark Erbaugh <mark at microenh.com> wrote:

> How do folks using vi to write their Python code find the 
> Python source of libraries used by their application? 

The following are very ugly but work: 

   !!echo 'import sys;print sys.path' | python
   !!echo 'import sys;print sys.modules' | python
   !!echo 'import sys;[sys.stdout.write('\''sys.module[\%s]="\%s"\n'\'' \% (i,str(sys.modules[i]))) for i in sys.modules]' | python

You could put such cruft in a shell script and call from vi: 

   !!foo

Of course I doubt that anyone does any of the above. 

Jim



More information about the CentralOH mailing list