1

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?

mic
  • 11
  • 1
  • 1
    I don't know anything about Python, but it looks as if you're outputting a after every character, while the VB code only outputs one after the set of three characters. – Jim Mack Oct 12 '20 at 16:30
  • You are right. Thank you very match! – mic Oct 13 '20 at 10:01

0 Answers0