Skip to content

Commit

Permalink
doc: update and fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
wang0618 committed Apr 19, 2020
1 parent abf0bb2 commit ee48893
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
# PyWebIO
<h1 align="center">PyWebIO</h1>
<p align="center">
<em>Write web app in script way.</em>
</p>
<p align="center">
<a href="https://percy.io/pywebio/pywebio">
<img src="https://percy.io/static/images/percy-badge.svg" alt="Percy visual test">
</a>
<a href="https://pywebio.readthedocs.io/zh_CN/latest/?badge=latest">
<img src="https://readthedocs.org/projects/pywebio/badge/?version=latest" alt="Documentation Status">
</a>
<a href="https://badge.fury.io/py/PyWebIO">
<img src="https://badge.fury.io/py/PyWebIO.svg" alt="Package version">
</a>
<a href="https://pypi.org/project/PyWebIO/">
<img src="https://img.shields.io/pypi/pyversions/PyWebIO.svg?colorB=brightgreen" alt="Python Version">
</a>
<a href="https://github.com/wang0618/PyWebIO/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/wang0618/PyWebIO" alt="License">
</a>
</p>

PyWebIO是一个用于在浏览器上获取输入和进行输出的工具库。能够将原有的通过终端交互的脚本快速服务化,供其他人在网络上通过浏览器访问使用;
PyWebIO还可以方便地整合进现有的Web服务,让你不需要编写Html和JS代码,就可以构建出具有良好可用性的Web程序。
Expand All @@ -8,6 +28,7 @@ PyWebIO还可以方便地整合进现有的Web服务,让你不需要编写Html
- 使用同步而不是基于回调的方式获取输入,无需在各个步骤之间保存状态,使用更方便
- 代码侵入性小,对于旧脚本代码仅需修改输入输出逻辑
- 支持多用户与并发请求
- 支持结合第三方库实现数据可视化
- 支持整合到现有的Web服务,目前支持与Tornado和Flask的集成
- 同时支持基于线程的执行模型和基于协程的执行模型

Expand Down Expand Up @@ -61,10 +82,11 @@ if __name__ == '__main__':
如果没有使用PywWebIO,这只是一个非常简单的脚本,而通过使用PywWebIO提供的输入输出函数,你可以在浏览器中与代码进行交互:

<p align="center">
<img src="https://raw.githubusercontent.com/wang0618/PyWebIO/master/docs/assets/demo.gif" alt="PyWebIO demo"/>
<a href="https://pywebio.herokuapp.com/">
<img src="https://raw.githubusercontent.com/wang0618/PyWebIO/master/docs/assets/demo.gif" alt="PyWebIO demo"/>
</a>
</p>


**向外提供服务**

上文对使用PyWebIO进行改造的程序,运行模式还是脚本,程序计算完毕后立刻退出。可以使用 [`pywebio.start_server()`](https://pywebio.readthedocs.io/zh_CN/latest/platform.html#pywebio.platform.start_server)`bmi()` 函数作为Web服务提供:
Expand Down Expand Up @@ -109,6 +131,11 @@ if __name__ == "__main__":

`http://localhost/bmi/` 页面上就可以计算BMI了

## Demos

- [数据可视化demo](http://pywebio-charts.wangweimin.site/) : 使用 plotly、pyecharts 等库创建图表
- [其他demo](https://pywebio.herokuapp.com/) : 包含PyWebIO基本输入输出演示和使用PyWebIO编写的小应用

## Document

使用手册和实现文档见 [https://pywebio.readthedocs.io](https://pywebio.readthedocs.io)
Expand Down
2 changes: 1 addition & 1 deletion pywebio/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def table_cell_buttons(buttons, onclick, **callback_options):
from functools import partial
def edit_row(choice, row):
put_text("You click %s button ar row %s" % (choice, row))
put_text("You click %s button at row %s" % (choice, row))
put_table([
['Idx', 'Actions'],
Expand Down

0 comments on commit ee48893

Please sign in to comment.