0.96" LCD.py fails

0.96" LCD.py fails

Error message is:

Python 3.7.3 (/usr/bin/python3)

%cd /home/pi/enviroplus-python/examples
%Run ‘0.96" LCD’
Traceback (most recent call last):
File “/home/pi/enviroplus-python/examples/0.96” LCD", line 12, in
img = Image.new(‘RGB’, (WIDTH, HEIGHT), color=(0, 0, 0))
NameError: name ‘WIDTH’ is not defined

Code is:
import ST7735
from PIL import Image, ImageDraw, ImageFont
disp = ST7735.ST7735(
port=0,
cs=1,
dc=9,
backlight=12,
rotation=270,
spi_speed_hz=10000000
)
disp.begin()
img = Image.new(‘RGB’, (WIDTH, HEIGHT), color=(0, 0, 0))
draw = ImageDraw.Draw(img)
rect_colour = (0, 180, 180)
draw.rectangle((0, 0, 160, 80), rect_colour)
from smbus2 import SMBus
from bme280 import BME280

bus = SMBus(1)
bme280 = BME280(i2c_dev=bus)
font_size = 18
font = ImageFont.truetype(“fonts/Asap/Asap-Bold.ttf”, font_size)

colour = (255, 255, 255)
temperature = “Temperature: {:.2f} *C”.format(bme280.get_temperature())

x = 0
y = 0
draw.text((x, y), temperature, font=font, fill=colour)
disp.display(img)

I “think” you need these two lines in you code above that line that errors.
WIDTH = disp.width
HEIGHT = disp.height