import/from import question

Gerhard Häring gh at ghaering.de
Mon Jun 30 00:51:35 CEST 2003


Artur M. Piwko wrote:
> Is there a way to detect if module was imported by 'from <mod> import <sth>'
> or by 'import <mod>'?

Provided that the information about imported modules is 'sys.modules', 
that's not possible.

-- Gerhard





More information about the Python-list mailing list