Advertisement
teslariu

exce

Jun 15th, 2021
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. import datetime
  5. from openpyxl import Workbook
  6.  
  7. libro = Workbook()
  8.  
  9. # activo una hoja del libro
  10. hoja = libro.active
  11.  
  12. # Agrego datos a las celdas
  13. hoja['A1'] = 42
  14.  
  15. # Agrego una lista de datos
  16. hoja.append([1, 2, 3])
  17.  
  18. # Guardo la fecha y hora
  19. hoja['F14'] = datetime.datetime.now()
  20.  
  21. # Guardo el archivo
  22. libro.save("pythonExcel.xlsx")
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement