User Tools

Site Tools


informatica:linux:python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
informatica:linux:python [2019/10/15 08:30] joseinformatica:linux:python [2024/11/10 23:57] (current) jose
Line 24: Line 24:
 </code> </code>
 ====== Fecha ====== ====== Fecha ======
 +Python 3
   import datetime   import datetime
   f"{datetime.datetime.now():%Y%m%d_%H%M%S}"   f"{datetime.datetime.now():%Y%m%d_%H%M%S}"
      
   '20191015_212507'   '20191015_212507'
 +Python 2
 +  from datetime import datetime
 +
 +  fecha = datetime.now() 
 +  print(fecha.strftime("%Y/%m/%d_%H:%M:%S"))
 +
 +
 +====== Entorno virtual ======
 +Para mas seguridad se crean entornos virtuales
 +
 +Crear entorno para vosk
 +  python3 -m venv ~/mi_entorno_vosk
 +USar el entorno
 +  source ~/mi_entorno_vosk/bin/activate
 +Ahora aparece en el prompt el entorno y los paquetes que se instalen están solo aquí
 +  (mi_entorno_vosk) jose@avtp239:~$ pip3 install vosk
 +
 +
 +
informatica/linux/python.1571128222.txt.gz · Last modified: 2019/10/15 08:30 by jose