未提供项目说明

roman-nums的Python项目详细描述


罗马数字

Python库来处理罗马数字。在

安装

使用包管理器pip安装roman nums。在

pip install roman-nums

基本用途

^{pr2}$

使用验证

>>>fromroman_nums.utilsimportrn_validator...>>>rn_validator('XLIV')True>>>rn_validator('XLIVV')False

处理文本

在文本中查找罗马和阿拉伯数字。转换它们。在

>>>fromroman_nums.utilsimportRText...text="""In 1066, Norman troops <...>.In the XII century, England conquered Wales, and at the beginning of the XVIII century <...>.""">>>worker=RText(text)>>>worker.from_roman()In1066,Normantroops<...>.Inthe12century,EnglandconqueredWales,andatthebeginningofthe18century<...>.>>>worker.to_roman()InMLXVI,Normantroops<...>.IntheXIIcentury,EnglandconqueredWales,andatthebeginningoftheXVIIIcentury<...>.>>>worker.rnb()# Will find all roman numbers['XII','XVIII']>>>worker.nb()# Will find all arabic numbers[1066]

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

推荐PyPI第三方库


热门话题
java如何重构以下代码   SpringJava拦截器读取请求体使请求为空   需要制作一个java程序,在netbeans上将UML图转换为java类   java在AsyncTask中获取空指针异常?   从泛型类集合中进行java类型安全检索   库存栏上方的java Minecraft信息栏完全人为创建   关于布局类型的java帮助   填写html表单而不提交,只需打开浏览器并填写字段即可。在爪哇   java查找列表相同位置的每个列表项的平均值<list<Double>>   关于编写富Web UI以前置RESTful HTTP API的java建议   cardView外部的java文本视图   java图像上传到服务器安卓 httppost   java如何使用公共代码从放心响应中提取cookie