0
私はサーマルプリンタを持っており、領収書の上にロゴを印刷したいと思います... png画像用のshutil.copyfileなどのものはありますか?Pythonはデフォルトのプリンタにpngファイルを送信します
私のコードでは、これは私が見つけることができたソリューションです
locations = ['/dev/usb/lp0', '/dev/usb/lp1', '/dev/usb/lp2']
size = locations.__len__()
i = 0
while i < size:
printer = locations[i]
try:
shutil.copyfile('output.txt', printer)
break
except IOError:
i += 1
if i == size:
logging.error('Unable to connect to the printer')
'size = len(locations)' ..私たちはreportlab(https://bitbucket.org/rptlab/reportlab)を使用してプリンタに接続するものですが、これは現在のものよりはるかに複雑です。 – thebjorn
ありがとうございました。私はまだ別の設定をしようとしていますが、私が間違いなくあなたが今述べたものを見ていきます。 – Soichiro
多分これは役に立ちます.. ..? https://forums.anandtech.com/threads/command-line-image-printing-in-linux.739845/ – thebjorn