本文整理匯總了Python中quex.engine.misc.interval_handling.NumberSet.get_string方法的典型用法代碼示例。如果您正苦於以下問題:Python NumberSet.get_string方法的具體用法?Python NumberSet.get_string怎麽用?Python NumberSet.get_string使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類quex.engine.misc.interval_handling.NumberSet
的用法示例。
在下文中一共展示了NumberSet.get_string方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test
# 需要導入模塊: from quex.engine.misc.interval_handling import NumberSet [as 別名]
# 或者: from quex.engine.misc.interval_handling.NumberSet import get_string [as 別名]
def test(UC):
global trafo_cp037
x = NumberSet(UC)
y = x.clone()
x.transform_by_table(trafo_cp037)
x.assert_consistency()
print "0x%02X --> 0x%s" % (UC, x.get_string(Option="hex"))
示例2: NumberSet
# 需要導入模塊: from quex.engine.misc.interval_handling import NumberSet [as 別名]
# 或者: from quex.engine.misc.interval_handling.NumberSet import get_string [as 別名]
x = NumberSet(UC)
y = x.clone()
x.transform_by_table(trafo_cp037)
x.assert_consistency()
print "0x%02X --> 0x%s" % (UC, x.get_string(Option="hex"))
for letter in xrange(-2, 258):
test(letter)
elif "all" in sys.argv:
x = NumberSet(Interval(0, 0x100))
y = x.clone()
x.transform_by_table(trafo_cp037)
x.assert_consistency()
print "0x%s --> 0x%s" % (y, x.get_string(Option="hex"))
elif "some" in sys.argv:
x = NumberSet(Interval(0, 0x32))
y = x.clone()
x.transform_by_table(trafo_cp037)
x.assert_consistency()
print "0x%s --> 0x%s" % (y, x.get_string(Option="hex"))
x = NumberSet(Interval(0x42, 0x80))
y = x.clone()
x.transform_by_table(trafo_cp037)
x.assert_consistency()
print "0x%s --> 0x%s" % (y, x.get_string(Option="hex"))
x = NumberSet(Interval(0xA0, 0xFF))