From 8fd05eb02bc78584bde9a55c0919991c81e0fdf0 Mon Sep 17 00:00:00 2001 From: Christoph Heuel Date: Sun, 29 Nov 2015 16:03:56 +0100 Subject: [PATCH] Add flush function * Flushing the file will cause the driver to flush the cache and print * the whole buffer. --- escpos/printer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/escpos/printer.py b/escpos/printer.py index 986d366..fd4e9e8 100644 --- a/escpos/printer.py +++ b/escpos/printer.py @@ -176,6 +176,10 @@ class File(Escpos): if self.device is None: print("Could not open the specified file %s" % self.devfile) + def flush(self): + """Flush printing content""" + self.device.flush() + def _raw(self, msg): """ Print any command sent in raw format """