Epson TM-U220B ネットワーク プリンターとキャッシュ ドロアーを持っています。私は自分のアプリケーションでプリンターを構成することができたPython Webアプリを開発しています。プリンタは正常に動作しています。チケットを印刷するまで開いておきたいだけです。引き出しまで開くためのコードをインターネットで見つけました。
コードは次のとおりです。
def print_(printer_name, file_path):
preorder = chr(27)+chr(100)+chr(0)
cut_paper = chr(29)+chr(86)+chr(66)+chr(0)
open_till = chr(27)+chr(112)+chr(10)
the_file = open(file_path, "a")
the_file.seek(0)
the_file.write(preorder)
the_file.seek(0,2)
the_file.write(cut_paper)
the_file.write(open_till)
the_file.close()
conn.printFile(printer_name, file_path, md5(file_path), {})
open_til は機能しないコードです。それ以外はすべて問題ありません
ありがとうございました