python - Difference in ways of importing modules -
If I have a module called FunctionLibrary , then what do I use in the import when I use The difference is
import the labels function and
the function library import * ?
There may be a list of
function libraries function or, with a class defined methods and variables, anything
please suggest .
How to call imported jobs I think you have foo () < / Code> and bar () .
Import function library FunctionLibrary.foo () FunctionLibrary.bar () And this:
< Code> function labry import * foo () times () do you see the differences? The first one requires the name of the module to call the function, while the latter allows you to call the function without any prefix.
But in both ways, it does not change again. Functional Library Import Foo, as the bar fl_bar foo () fl_bar ()
to you < This last method you can use pre-> allows you to write aliases to call Python functions. You will need it in the case of work (or something) with the same names in your imported module.
You can nick your library, such as
from the function library fl import bar such as B fl.b () # call FunctionLibrary.bar ()
Comments
Post a Comment