🧰 Tools¶
Constants¶
- thermalprinter.tools.ls(*consts: type [enum.Enum ]) None ¶
Print constants values.
Print all constants:
>>> ls()Print
thermalprinter.constants.Chineseconstant values:>>> ls(Chinese)Print
thermalprinter.constants.Chinese, andthermalprinter.constants.CodePage, constant values:>>> ls(Chinese, CodePage)
Statistics¶
Simple printer statistics can be persisted into the thermalprinter.constants.STATS_FILE file. They are enabled by default unless use_stats is set to False (see thermalprinter.ThermalPrinter()).
- thermalprinter.tools.stats_load() dict [str , int ]¶
Load statistics from the
thermalprinter.constants.STATS_FILEfile.
- thermalprinter.tools.stats_save(printer: ThermalPrinter) None ¶
Save printer statistics to the
thermalprinter.constants.STATS_FILEfile.- Parameters:
printer (ThermalPrinter) – The Printer.