Python function clImport()
Function clImport()
has this
syntax:
clImport(module, *funcs)
module
is the module name, or the
bare file name that is the module name with the extension .py. The variadic parameter *funcs
indicates you can give an
arbitrary list of functions.
You can use function clImport
similar to the import
statement. For example,
functions foo_1()
and foo_2()
are defined in a module named bar
. In this instance, the file name is
bar.py.
import bar
bar.foo_1()
You can invoke clImport
with only one
argument:
clImport("bar") # or clImport("bar.py")
bar.foo_1()
You can also use the import
statement:
from bar import foo_1, foo_2
foo_1()
You can invoke clImport
with more
arguments:
clImport("bar", "foo_1", "foo_2") # or clImport("bar.py", "foo_1", "foo_2")
foo_1()