Skip to content

Commit 8165c22

Browse files
Fix import statements for Image, ImageDraw
1 parent 0ae093e commit 8165c22

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
from __future__ import print_function
1818
import RPi.GPIO as GPIO
19-
import subprocess, time, Image, socket
19+
import subprocess, time, socket
20+
from PIL import Image
2021
from Adafruit_Thermal import *
2122

2223
ledPin = 18

sudoku-gfx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from __future__ import print_function
2424
import sys, os, random, getopt, re
2525
from Adafruit_Thermal import *
26-
import Image
26+
from PIL import Image
2727

2828
printer = Adafruit_Thermal("/dev/serial0", 19200, timeout=5)
2929
bg = Image.new("1", [384, 426], "white") # Working 'background' image

timetemp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
from __future__ import print_function
1717
from Adafruit_Thermal import *
18-
import Image, ImageDraw, time, urllib, json
18+
import time, urllib, json
19+
from PIL import Image, ImageDraw
1920

2021
API_KEY = "YOUR_API_KEY"
2122

@@ -166,4 +167,4 @@ def numWidth(str, list):
166167
# Open connection to printer and print image
167168
printer = Adafruit_Thermal("/dev/serial0", 19200, timeout=5)
168169
printer.printImage(img, True)
169-
printer.feed(3)
170+
printer.feed(3)

0 commit comments

Comments
 (0)