PYTHON

Description

Aprendizaje Python
Christian Gutierrez Ramirez
Mind Map by Christian Gutierrez Ramirez, updated more than 1 year ago
Christian Gutierrez Ramirez
Created by Christian Gutierrez Ramirez almost 4 years ago
11
0

Resource summary

PYTHON
  1. Modulos
    1. Que es?

      Annotations:

      • Modules in Python are simply Python files with the .py extension, which implement a set of functions. Modules are imported from other modules using the import command
      1. Como se crean?

        Annotations:

        • Writing modules Writing Python modules is very simple. To create a module of your own, simply create a new .py file with the module name, and then import it using the Python file name (without the .py extension) using the import command. Writing packages Packages are name-spaces which contain multiple packages and modules themselves. They are simply directories, but with a twist. Each package in Python is a directory which MUST contain a special file called _init_.py. This file can be empty, and it indicates that the directory it contains is a Python package, so it can be imported the same way a module can be imported.
        1. Modulos

          Annotations:

          • nombre_modulo.PY para importar: IMPORT nombre_modulo(sin .py) Writing modules Writing Python modules is very simple. To create a module of your own, simply create a new .py file with the module name, and then import it using the Python file name (without the .py extension) using the import command.
          1. Paquetes

            Annotations:

            • Crear una carpteta que contenga los modulos, la carpeta debe tener un archivo __init__ para que el sistema la reconozca CARPETA: ARCHIVOS: __init__(puede estar vacio) nombre_archivo.py(contine la funciones) SUBCARPETA: ARCHIVOS:__init__(puede estar vacio) nombre_archivo.py(contine funciones) Writing packages Packages are name-spaces which contain multiple packages and modules themselves. They are simply directories, but with a twist. Each package in Python is a directory which MUST contain a special file called _init_.py. This file can be empty, and it indicates that the directory it contains is a Python package, so it can be imported the same way a module can be imported.
          2. Como los uso en un programa?

            Annotations:

            • FROM nombre_carpeta.nombre_archivo(sin .py) IMPORT funcion(sin()) Uso en el programa: funcion() FROM nombre_carpeta.nombre_subcarpeta IMPORT nombre_archivo (sin .py) Uso en el programa: nombre_archivo.funcion() la primera parte del codigo es el nombre de la carpeta contenedora, despues del punto va el nombre del archivo sin el .pyPara llamar alguna funcion se debe usar el nombre del programa seguido de . y la funcion o el nombre de la funcion que importamos
          Show full summary Hide full summary

          Similar

          Python
          Jay Prakash
          Python Quiz
          karljmurphy
          Think Python
          tsilvo2001
          Basic Python - Print Formatting
          Rebecca Noel
          What is Python?
          Daniel Ingram
          Python
          54671
          Know your Python!
          educ8ict
          Basic Python - Strings
          Rebecca Noel
          Study on IoT systems design
          Tomasz Cieplak
          Python
          Kirstie Wu
          OpenSource Programming
          Faheem Ahmed