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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -