Jan-27-2019, 10:50 AM
I'm a bit confused,
I want for example to send 27 120 0 to set it in Utility mode.
When I do :
I want for example to send 27 120 0 to set it in Utility mode.
When I do :
printer = open("LPT1", "w") printer.write("\x27\x120\x0") printer.closeIt says I can't use more that two numbers:
Error:File "C:\Documents and Settings\Administrateur\Bureau\test.py", line 2
printer.write("\x27\x120\x0")
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 9-11: truncated \xXX escape
And when I do : printer = open("LPT1", "w") printer.write(chr(27), chr(120), chr(0)) printer.closeIt obviously tells me that printer.write takes only one argument and that I gave 3 of them.