python 导包

__init__.py is needed under the package where you want to put your own py files

or this directory wont be recongnised as a python package

__init__.py can be empty file

 

use fill path you can access the defined method

method under __init__.py can be accessed using directory name

 

import myweblib
import myweblib.WAITELEMENT


#access __init__.py method by path
myweblib.defineininit()

#access method of py files under dir by path
myweblib.WAITELEMENT.elem_select_by_opt(driver, "issue_status_id", 0, "1")

#dirpath + filename consist of path

 

你可能感兴趣的:(python)