2024-05-18 23:40:29 发布
网友
我需要生成一个numbre序列,例如从数组中的1 to 100(这个数字可能要大得多)生成,但是像文本一样
1 to 100
[ 'one', 'two', 'three', ... 'one hundred', ]
有这样的图书馆吗?或者我必须手动操作?如果有办法用西班牙语来做这件事,那就更好了
这可能会对您有所帮助,但为了用西班牙语完成这项工作,您需要理解代码并稍微修改代码 https://www.geeksforgeeks.org/convert-number-to-words/
编辑: 我认为这将有助于您在本模块中支持多种语言 https://pypi.org/project/num2words/
使用拐点:
>>>import inflect >>>p = inflect.engine() >>>p.number_to_words(1234) u'one thousand, two hundred and thirty-four'
您必须手动执行此操作,只需使用“替换”
这可能会对您有所帮助,但为了用西班牙语完成这项工作,您需要理解代码并稍微修改代码 https://www.geeksforgeeks.org/convert-number-to-words/
编辑: 我认为这将有助于您在本模块中支持多种语言 https://pypi.org/project/num2words/
使用拐点:
您必须手动执行此操作,只需使用“替换”
相关问题 更多 >
编程相关推荐