简体   繁体   中英

Regarding import statement in pox controller

I am reading the source code of pox controller. There is an import statement in one module called l3_editing.py which is modified based l3_learning.py .

The import statement is:

from pox.lib.recoco import Timer

Because I do not know Timer , I just along with the source tree to find this struct. But I cannot find this struct Timer, which really make me confused. It should be in pox/lib/recoco.py , but there is no module named recoco.py under lib package.

Items below pox/lib:

痘/库

Items below pox/lib/recoco :

痘/库/可可

The lib directory is a python package. It contains an __init__.py file . When you import a package this will cause any __init__.py file to be executed. So what's in there?

Just one line:

from recoco import *

Great we are getting closer! Lets look in recoco.py :

...
class Timer (Task):
  """
  A simple timer.
...

There you have it!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM