提供字母数字类型的包

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第三方库


热门话题
java为什么我不能在try/catch中键入多个输入?   当文件名为泰语时,enctype=“multipart/formdata”的java upload file获得了奇怪的文件名   java使用jsp在tomcat中开发kerberos   Java\JSON:无法识别的属性异常:无法识别的字段“CefMessagesGenerators”错误   java在片段中删除工具栏   java ActionListener无法处理所有对象   JAVA调用从其他包继承的类的成员(其他类类型)   java RestyGWT和GWT集成:无法获取资源   java如何检查正在执行的类   java JavaFX自定义节点不呈现子节点   持久性如何在java中非持久地存储列表的内容   java EditText在禁用时恢复为灰色文本