提供字母数字类型的包

AlphaAffixedNumericType的Python项目详细描述


字母表数字类型(aant)

Python数据类型来支持字母数字字符串上的算法

支持的算法类型

  • 添加 aant + integer *注意:整数类型必须在加法运算符的右侧

  • 减法 aant - [integer|aant]

如何使用

fromAlphaAffixedNumericTypeimportAlphaAffixedNumericTypeaant=AlphaAffixedNumericType('A123')print(aant+1)# prints 'A124' print(aant+1000)# prints 'A1123' aant+=10print(aant.get_value())# prints 'A133'aant2=AlphaAffixedNumericType('A123B')aant3=AlphaAffixedNumericType('A124B')print(aant2-aant3)# prints -1 print(aant2-200)# raises 'NumericArithmeticException' - Numeric part of aant2 (123) is less than 200aant4=AlphaAffixedNumericType('A0001B')print(aant4+1000)# prints 'A1001B' 

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
servlet控制器中的java空指针异常   java部署Maven项目无法添加jersey原型   Java邮件跳回了邮件的地址   java Android Studio:尝试调用虚拟方法“void Android”。小装置。图像按钮。空对象引用上的setImageResource(int)“”   java如何在服务中使用倒计时更新文本   java如果没有更多的异常,我如何停止获取输入?   java将页码放入文档中   名为[<name>]的java hibernate参数不存在   java如何在JTextPane中动态生成新行?   java LinkedList对“get()”使用迭代器以加快迭代速度   java Junit 4.12问题测试异常   rest密钥斗篷从Java导入领域“创建”?   如何并行执行oracle java存储过程   java如何保存用户上次读取的页码   java操作系统。getSystemCpuLoad()始终返回相同的值