How to get a object from another module?
<p>A.py</p>

<pre><code># logging object
logger = ""

def log():
        """
        a log handle
        """
        global logger, doc_log

        import logging.handlers
        logger = logging.getLogger("autons_log")
        logger.setLevel(logging.DEBUG)

        MAX_SIZE = 800 * 1024 * 1024
        LOG_PATH = doc_log + "/autons_log.log"
        fh = logging.handlers.RotatingFileHandler(LOG_PATH, maxBytes=MAX_SIZE, backupCount=8)

        formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
        fh.setFormatter(formatter)

        logger.addHandler(fh)

def get_log():
        """
        get the object of logger
        """
        global logger
        return logger
</code></pre>

<p>and B.py</p>

<pre><code>def hello():
        """
        """
        import autons_nc
        print autons_nc.get_log()
        print type(autons_nc.get_log())
        autons_nc.get_log().debug('hello')
</code></pre>

<p>I want to use the object of logger in B.py,But this way can't work.
the type of get_log() is "type 'str'" not "class 'logging.Logger'".</p>

<p>So, another way can solve it? Thank you</p>

<p>By the way, autons_nc.py is A.py</p>
