代码拉取完成,页面将自动刷新
同步操作将从 王伟民/pywebio-chart-gallery 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import re
from os import path
import tornado.ioloop
import tornado.web
from tornado.options import define, options
from cutecharts_demo import cutecharts
from pyecharts_demo import pyecharts
from plotly_demo import plotly_demo
from pywebio import STATIC_PATH
from pywebio.output import put_markdown, set_auto_scroll_bottom, set_title
from pywebio.platform.tornado import webio_handler
def index():
set_title("PyWebIO Chart Gallery")
set_auto_scroll_bottom(False)
readme_file = path.join(path.dirname(__file__), "README.md")
readme = open(readme_file).read()
readme = re.sub(r"\[\*\*demos\*\*\]\(.*?\?pywebio_api=(.+?)\)", r"[**demos**](./?pywebio_api=\g<1>)", readme)
cdn = r"https://cdn.jsdelivr.net/gh/wang0618/pywebio-chart-gallery@master"
readme = re.sub(r"!\[(.+?)\]\(.*?(.+?)\)", r"![\g<1>](%s\g<2>)" % cdn, readme)
readme = re.sub(r"<div></div>[\s\S]*$", "", readme)
put_markdown(readme)
if __name__ == "__main__":
define("port", default=8080, help="run on the given port", type=int)
tornado.options.parse_command_line()
application = tornado.web.Application([
(r"/io", webio_handler(index)),
(r"/cutecharts", webio_handler(cutecharts)),
(r"/pyecharts", webio_handler(pyecharts)),
(r"/plotly", webio_handler(plotly_demo)),
(r"/(.*)", tornado.web.StaticFileHandler, {"path": STATIC_PATH, 'default_filename': 'index.html'})
])
application.listen(port=options.port)
tornado.ioloop.IOLoop.current().start()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。