Wrote a small script - just trying to get used to the os, sys, and some other common modules/libraries available to python at install. The gist: The script is designed to search the python directory for all available modules (whether they are installed or not), then it is suppose to check what modules are currently loaded, then it offers an option to dynamically load a module of your choice - using '__import__() because I am passing a string to it - (this is where I am having a problem - but I'll get back to it shortly)...then it gives the option to "browse" the module for all its classes, functions, etc. (using dir([module name]) ...).
The problem:
when the module is loaded dynamically - it is embedded in a try/except statement - if it succeeds it reports that the "module is loaded" and if it fails it reports...duh..."Failed to load..."
If you type the name of a module, for example a module named "uu", it says "loaded". So I know it is loading - however, when I go back and call the function that checks all of the LOADED modules - it is blank (using sys.modules)
I am thinking that python is loading the module into a temporary place which is not sys.modules because when I exit out of the script and check sys.modules it is not there.
Any help would be appreciated...
http://paste.pocoo.org/show/183TNX63ezVaKIcGciiy/
for the script - it wont entirely because it requires a module/script that I borrowed from someone else. But you can see the calls I am using from the standard library in the menu options 2, 3, and 4.
Thank you,
-J