Importing, creating and using modules/libraries

The modules and libraries are this beautiful things that you will find when you are programming. These ones help us when we are programing and we need a function that already exists. Like when you need that your program make a random action the only thing that you need to do is import the library random:

screen-shot-2016-10-27-at-1-59-11-pmAs you can see we use one specific function from de library random, that actually have a lot, if you want to se more: Random library

We can have the same result of a module as a library, but the difference between these is that a module is a file that has a lot of functions inside it and is save like a .py file, for other side a library already exist and you only import when you need to use it. In few word, you do and use a module and you only use a library.

When you want a specific function from a module or library you write:

from module/library import specific 

 

Deja un comentario