This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Definición de los pines | |
const int pinBtn1 = 2; | |
const int pinBtn2 = 3; | |
const int pinSB1 = 4; | |
const int pinSB2 = 5; | |
const int pinRNB2 = 7; | |
const int pinRNB1 = 8; | |
const int pinRPB2 = 9; | |
const int pinRPB1 = 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# Función dependiente de la librería: | |
def limpiar(): | |
if os.name == "nt": # "nt" -> Windows // "posix" -> Mac | |
os.system("cls") # Para Windows | |
else: | |
os.system("clear") # Para Linux | |
limpiar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prueba realizada en: https://www.sololearn.com/Codes/ | |
# ---------------------------------------------------------------- | |
# La librería "time" no funciona correctamente en Windows, es por | |
# ello que se recomienda que ejecute el código en entornos online. | |
import time as t | |
cad = "192.168.10.15/24" | |
# Método 1: | |
inicio = t.time() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def acumular(lista, paso=100): | |
lista[0] += 1 | |
for i in range(len(lista)): | |
if lista[i] >= paso: | |
lista[i] = 0 | |
try: | |
lista[i+1] += 1 | |
except IndexError: | |
lista.append(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lista_A = [2, 8, 18, 32, 50, 72, 98] # tn = 2n**2 | |
lista_A_Copy = lista_A.copy() | |
suma = n = 0 | |
limite = 1 | |
while n<=limite: | |
if n==0: | |
try: | |
limite = int(input()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import selectors, sys | |
def timed_input(prompt="", timeout=10): | |
sel = selectors.DefaultSelector() | |
sel.register(sys.stdin, selectors.EVENT_READ, input) | |
respuesta = None | |
print(prompt, end="") | |
events = sel.select(timeout=timeout) | |
if events: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Autor: Magh | |
Fechas: | |
16/02/2022 (v1.1) | |
14/02/2022 (v1.0) | |
Descripción: | |
En la entrada de datos se ingresa la dirección.IP/Máscara | |
y dará como resultado el siguiente esquema: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Audio a texto. | |
El tipo de archivo tiene que ser .wav | |
@author: Magh | |
""" | |
import speech_recognition as sr | |
r = sr.Recognizer() |