本文整理汇总了Python中Adafruit_Thermal.hasPaper方法的典型用法代码示例。如果您正苦于以下问题:Python Adafruit_Thermal.hasPaper方法的具体用法?Python Adafruit_Thermal.hasPaper怎么用?Python Adafruit_Thermal.hasPaper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Adafruit_Thermal
的用法示例。
在下文中一共展示了Adafruit_Thermal.hasPaper方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Adafruit_Thermal
# 需要导入模块: import Adafruit_Thermal [as 别名]
# 或者: from Adafruit_Thermal import hasPaper [as 别名]
#!/usr/bin/python
from Adafruit_Thermal import *
printer = Adafruit_Thermal("/dev/ttyAMA0", 19200, timeout=5)
if printer.hasPaper() == True:
print"There is paper in the printer"
else:
print "There is no paper in the printer"
# Test inverse on & off
printer.inverseOn()
printer.println("Inverse ON")
printer.inverseOff()
# Test character double-height on & off
printer.doubleHeightOn()
printer.println("Double Height ON")
printer.doubleHeightOff()
# Set justification (right, center, left) -- accepts 'L', 'C', 'R'
printer.justify('R')
printer.println("Right justified")
printer.justify('C')
printer.println("Center justified")
printer.justify('L')
printer.println("Left justified")
# Test more styles
printer.boldOn()