Addressing python objects
问题 I'm trying to use ncclient for Python. If I do this it works: from ncclient import manager m = manager.connect() If I do this it fails: import ncclient m = ncclient.manager.connect() The error is AttributeError: 'module' object has no attribute 'manager' . I don't understand what the difference is. Shouldn't that be the same method either way? Why isn't it? 回答1: Importing a module (package) does not automatically import submodule. (Some modules do. For example, importing os module also import