TeddyIP
Posts: 22
Joined: Fri Jul 20, 2018 9:47 am

Change fieldnames colour

Sat Aug 11, 2018 1:47 pm

Good morning all,
I am currently using a Raspberry IP 3, programming in Python (3.5.3), power supply is a Samsung charger. (No GPIO's are used atm).
I wish to edit the properties of cells in LibreOffice Calc. I would like to change the cells colour if an entry to a cell is (val=<0), or user just decided to press (Enter).

Code: Select all

import csv,io,sys,cmd,time,builtins,RPi.GPIO as GPIO 
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)


def OpenFile():
  with open('/home/pi/Documents/FileCalc.xlsx','w',newline=None) as csvfile:
    Column = ('_','datetime','ID','FirstName','OtherNames','LastName','Age','Address','Contract_ID','Department')
    Row_A = ('A1','B1','C1','D1','E1','F1','G1','H1','I1','J1','K1','L1','M1','N1','O1','P1')

    
    write = csv.DictWriter(csvfile, fieldnames=Row_A)
    write.writeheader()
def ReadFile():

  with open('/home/pi/Documents/FileCalc.xlsx', 'r') as csvfile:
    read = csv.DictReader(csvfile)
 

OpenFile()
ReadFile()

Return to “Python”