简体   繁体   English

如何读取python包的内容?

[英]How to read the content of a python package?

I recently installed inflect.py package to use the ordinal() function which formats a number as "1st" as apposed to "1", or "one". 我最近安装了inflect.py软件包,以使用ordinal()函数,该函数将数字的格式设置为与“ 1”或“ one”相对应的“ 1st”。 I'm new to programming and had been attempting to write a function to do this myself, but eventually found a link to this package as a solution to the problem. 我是编程的新手,一直在尝试自己编写一个函数来完成此操作,但最终找到了此程序包的链接以解决此问题。

I want to know if there is a way to view the code of the inflect.py package so i can try to understand how ordinal() works. 我想知道是否有一种方法可以查看inflect.py程序包的代码,这样我就可以尝试了解ordinal()工作原理。

我想这是inflect包的源代码存储库inflect : //github.com/jazzband/inflect-您可以在此处检查源代码和函数实现...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM