#! /usr/bin/env python from time import sleep from Adafruit_I2C import Adafruit_I2C from Adafruit_MCP230xx import Adafruit_MCP230XX from Adafruit_CharLCDPlate import Adafruit_CharLCDPlate from subprocess import call from sys import exit from sys import argv ####### Open text File and set data as the variable ##### f = open('text.txt','r') # open in read mode data = f.read() ##### This only Reads Last Line of Text File ###### ############ LCD set as Variable ############ lcd = Adafruit_CharLCDPlate(busnum = 1) ########## Line to Open the text file and display the contents ####### try: lcd.clear() lcd.backlight(lcd.GREEN) lcd.message("i can read\n"+ data) sleep(5) lcd.clear() lcd.backlight(OFF) except : lcd.backlight(OFF) exit()