Creating libraries/modules

--Originally published at Sierra's Blog

A module is a file saved as .py

When you create a new file you’re actually creating potentially a new librarie.

i’ll explain it with some examples:

creatinglibraries

this is a new file saved as ejemplo1.py, in this file i¿m importing a file that I already create called vectores.py. By importing it, now i’ll be able to use all the functions that I created in vectores.py, in this example im using the function called bienvenida, which welcomes the user and tells you what does the program do.

to make this work you need this format:

1.- import the file were the functions are. (in this case Vectores.py)

2.- to call a function of vectores.py you need to write with this format: name_of_the_file”.”name_of_the_function(parameters).(in this case: Vectores_bienvenida()<- no parameter).

Conclusion: everytime you create a new file you’re creating a new librarie to use.