项目
在 GitHub 查看
danijar/handout
关于
使用 Markdown 和插图将 Python 脚本转换为讲义
数据与分析可以做什么
- Add Markdown text as triple-quote comments. - """Markdown text"""
- Add text via print() syntax. - doc.add_text('text:', variable)
- Add image from array or url. - doc.add_image(image, 'png', width=1)
- Add video from array or url. - doc.add_video(video, 'gif', fps=30, width=1)
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- -1
- 1个月
- -3
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Python Handout
Turn Python scripts into handouts with Markdown comments and inline figures. An alternative to Jupyter notebooks without hidden state that supports any text editor.
| Code | Handout |
|---|---|
![]() |
![]() |
Getting started
You use Python Handout as a library inside a normal Python program:
- Install via
pip3 install -U handout. - Run your script via
python3 script.py. (You can start withexamples/start.pyfrom the repository.) - Open
output/index.htmlin your browser to view the result. - Iterate and refresh your browser.
Features
Create the handout via doc = handout.Handout(outdir) to access these features:
| Feature | Example |
|---|---|
| Add Markdown text as triple-quote comments. | """Markdown text""" |
Add text via print() syntax. |
doc.add_text('text:', variable) |
| Add image from array or url. | doc.add_image(image, 'png', width=1) |
| Add video from array or url. | doc.add_video(video, 'gif', fps=30, width=1) |
| Add matplotlib figure. | doc.add_figure(fig, width=1) |
| Add custom HTML. | doc.add_html(string) |
Insert added items and save to <outdir>/index.html. |
doc.show() |
Questions
Feel free to create an issue on Github.
探索相关项目
加载中…

