Check out the 'importall' module. It is written for this purpose.
You may have to adapt it to check a particular directory instead
everythong on sys.path. It assumes that importing a module isn't that
drastic (in particular that the module doesn't start its main()
program right away -- this should only done if __name__ == '__main__').
> Further, I wonder if it is possible to generate a "compiled"
> version of python scripts.
That's not necessary -- .pyc files ARE compiled versions. (If I
understand your question correctly.)
If you mean to generate a stand-alone binary, the "freeze" script
(Demo/scripts/freeze.py) is supposed to do that. It is broken in the
1.0.1 distribution but Jaap Vermeulen gave me a fixed version which
will be distributed in 1.0.2.
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>