每次我调用 Convert() 或 send() 函数时,Python 代码都会维护我在列表中打印的徽章。
因此,每次我尝试打印新徽章时,它都会首先打印所有旧徽章。
在我执行 Convert() 和 send() 命令进行打印后,任何人都可以看到如何从列表中删除徽章图像吗?
这是代码:
import pygame
import time
from PIL import Image
from brother_ql.conversion import convert
from brother_ql.backends.helpers import send
from brother_ql.raster import BrotherQLRaster
from brother_ql.backends import backend_factory, guess_backend
#####################################################################################################
### Test QR-800 Printer
#####################################################################################################
# Here I just get two images each of size 1044x696
image1 = Image.open('RedBlack1_1044x696.png')
image2 = Image.open('RedBlack2_1044x696.png')
backend = 'linux_kernel' # 'pyusb', 'linux_kernel', 'network'
model = 'QL-800' # your printer model.
printer = '/dev/usb/lp0'
qlr = BrotherQLRaster(model)
qlr.exception_on_warning = True
badge = convert(
qlr=qlr,
images=[image1], # Takes a list of file names or PIL objects.
label='62red',
rotate='90', # 'Auto', '0', '90', '270'
threshold=70.0, # Black and white threshold in percent.
dither=False,
compress=False,
red=True, # Only True if using Red/Black 62 mm label tape.
dpi_600=False,
lq=False, # True for low quality.
no_cut=False
)
跃然一笑
相关分类