gpt4 book ai didi

python:doctest我的github-markdown文件?

转载 作者:太空狗 更新时间:2023-10-29 21:08:39 25 4
gpt4 key购买 nike

我想从这个文件运行 doctests,但我不清楚如何完成它:

README.md:

# WELCOME!

This library is helpful and will help you in _many_ ways!

For example:

```
>>> import library
>>> library.helps()
True
```

(旁白:谁能帮我把这个高亮显示为 markdown?)

最佳答案

您可以在命令行上的README 上运行doctest:

python -m doctest -v README.md

-m parameter告诉 Python 将以下模块作为脚本运行。 When run as a script , doctest 模块运行 doctest.testmod对以下文件的功能。最后,-v 参数使 doctest 以详细模式运行;如果它被关闭,doctest 只在至少一个测试失败时产生输出(如果一切都成功则不会产生输出)。

关于python:doctest我的github-markdown文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23250068/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com