Escape 0x1b;t;0x7 command code For printer

189 views Asked by At

How I can translate following working VisualBasic code to Python?

print #1,Chr$(&H1B) & "t" & Chr$(7)(running on Windows)

I tried this (for Ubuntu):

    kkm_port = open(stg.kkm_port,"a")
    print >> kkm_port,chr(0x1B)
    print >> kkm_port,"t"
    print >> kkm_port,chr(7)

This code must switch termal printer CITIZEN CT-S310 codepage. Whats wrong?

0

There are 0 answers