Mastery 14 Creating and using a Python module

In this mastery I will introduce you to how to create a module in python and use it. firs lets get clear what is a module.A module is Python files that contain pre-built functions. Now  to creat a module we have to creat a file with the extension “.py”,(that represen tha the file is a file python),and save it on the main folder of python.The direction of this folder can be found on C:Python34.

In this file you can create as many functions as you want after you create your function you save it. So now that your functions are in you module and your mudule is in you main folder of python, you can use it, writing “import” followed the name of the module, but that is not all, with import you open the module but now you have to choose which fuction you are going to use. You have to write the name of the module, point, the name of the function and in parentheses the variable to which we want to apply the function.

here is a video where you can learn very easy how to do it step by step: https://www.youtube.com/watch?v=xRQA1Fy1HFQ

 

CC BY 4.0 Mastery 14 Creating and using a Python module by Efrain Duarte is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.