I encountered this piece of python code (pasted below) on effbot and I was wondering:
Why defining a function within a function?
import
It's just another way of breaking down a large function into smaller pieces without polluting the global namespace with another function name. Quite often the inner function isn't a stand-alone so doesn't rightfully belong in the global namespace.