Advertisement
teslariu

modulos1

Nov 16th, 2022
852
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. """
  5. MODULO: cualquier archivo .py
  6. BIBLIOTECA: es una carpeta con módulos que posee SI O SI el módulo
  7.           __init__.py GENERALMENTE VACIO
  8. PAQUETE:es un carpeta con biblioteca y mòdulos con una estructura
  9.        especial (archivos especiales) que permiten distribuir software
  10.  
  11. dir
  12.    paquete
  13.    |________ __init__.py
  14.    |________  modulo1.py
  15.    |________  modulo4.py
  16.    |________  subpaquete
  17.                |__  __init__.py
  18.                |__  modulo4.py
  19.                |__   modulo3.py
  20.                        |___sumar
  21.                        |___ now()
  22.            
  23. NAMESPACE: es la ruta para llegar a un módulo:
  24. EJ: namespace de módulo3: paquete.subpaquete
  25.  
  26. """
  27. # import math  # importa el modulo math completo
  28. # import math as m  # importa todo math pero lo renombra, m.sqrt(22)
  29. # from math import sin, cos as coseno # importa sin y cos renombrandolo como coseno
  30. # from math import *  # importa todas las funciones de math pero no hay que escribir math: sqrt(22)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement