I found it!
def__del__(self): ifself.device isnotNone: self.device.reset() ############### <<<< THIS IS THE KEY>>>> (added to all code) usb.util.dispose_resources(self.device) W dniu 01.04.2020 o 09:09, Tormod Volden pisze: > On Tue, Mar 31, 2020 at 8:34 PM Marcin Chuć wrote: >> I have an ESC printer. I made a simple script to send data to the device, >> but after changing the content of the script - 1x the previous version of >> the subtitles is printed, and then, when called again, the current one. As >> if the data from the USB was cached somewhere. How can I make some FLUSH? >> >> usb_= Connector(showUsbDevices=False) >> usb_.send(b'I LOVE YOU') > Hi Marcin, > > If you look at other code for communicating with such printers, you > will see that there is a lot of printer control codes and protocol on > top of the USB communication. With just sending these few text > characters, you are probably causing a flush of the existing buffer > and at the same time filling it up again with your new text. > > See for instance this hint: > https://github.com/mike42/escpos-php/blob/development/src/Mike42/Escpos/Printer.php#L988 > > Regards, > Tormod > > > _______________________________________________ > pyusb-users mailing list > pyusb-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pyusb-users
pEpkey.asc
Description: application/pgp-keys
_______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users