You've already forked Curso-lenguaje-python
Update Python Ofensivo
This commit is contained in:
26
python-ofensivo/00_ejercicios/07_modulos01.py
Normal file
26
python-ofensivo/00_ejercicios/07_modulos01.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
Se puede ver con dir() las funciones que tiene un módulo
|
||||
|
||||
Con builtin_module_names se puede ver los módulos que vienen por defecto en python
|
||||
|
||||
Por supuesto, se pueden ver todos los módulos descargados con pip con:
|
||||
pip freeze
|
||||
|
||||
Se puede ver la ubicación de un módulo externo con __file__
|
||||
|
||||
"""
|
||||
|
||||
import math
|
||||
import sys
|
||||
import hashlib
|
||||
|
||||
|
||||
print(dir(math))
|
||||
print()
|
||||
print(sys.builtin_module_names)
|
||||
print()
|
||||
print(hashlib.__file__)
|
||||
print()
|
||||
|
||||
# Ejemplo de uso hashlib
|
||||
print(hashlib.md5(b'Hello World').hexdigest())
|
||||
Reference in New Issue
Block a user