Some more information on finding python, its modules and whether they are built-in, modules of the standard distribution or those in the site-packages folder
References:
29.12. inspect — Inspect live objects — Python 3.4.4 documentation look at the table on Types and Members
http://stackoverflow.com/questions/247770/retrieving-python-module-path just one of hundreds of examples.
| Type | Attribute | Description |
|---|---|---|
| module | __doc__ | documentation string |
| __file__ | filename (missing for built-in modules) |
| Tips | Example |
|---|---|
A standard installation compatible with ArcMap and arcpy is assumed. These:
are your friends. Look for a __file__ property in the function/property list. | The os module does... The time module doesn't |
Modules in the C:\PythonXX\lib\ folder will have a __file__ property. | |
| Modules that aren't part of the standard distribution and have to be installed via pip or other means, get put in the site-packages folder and they will have a __file__ | How about arcpy? And my fav... |
| You can use the inspect module as well... all the cool programmers do ... | Numpy was previously imported as np. Notice the results are the same as the np.__file__ approach. Lets try time. No... it is a built-in. But... you can another way... |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.