什么?可以在 HTML 中直接插入 Python 代码?

PyScript 由来自 Anaconda 的团队开发,是一个用于在 HTML 中插入 Python 代码的工具,这意味着你可以在 HTML 中编写和运行 Python 代码,在 PyScript 中调用 Javascript 库,并在 Python 中进行所有的 Web 开发,是不是很神奇!

什么?可以在 HTML 中直接插入 Python 代码?

有了 PyScript,我们现在可以在 HTML 中编写 Python 代码并构建 Web 应用了,PyScript 可以让更多的前端开发者接触到 Python 的强大功能。有了 PyScript,我们不再需要担心部署问题,因为一切都将在你的浏览器中执行,比如作为数据科学家,你可以在一个 html 文件中分享模型,只要其他人在浏览器中打开该文件,就会运行代码了。

什么?可以在 HTML 中直接插入 Python 代码?

PyScript 是基于 Pyodide(https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pyodide.orghttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712) 开发的,它是 CPython 到 WebAssemblyhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712Emscripten 的入口,PyScript 支持在浏览器中编写和运行 Python 代码,未来还将提供对其他语言的支持。

什么?可以在 HTML 中直接插入 Python 代码?

什么是 WebAssembly?

使得用 Python 编写网站成为可能的基础技术是 WebAssembly。最初开发 WebAssembly 时,Web 浏览器仅支持 Javascript。WebAssembly 于 2017 年首次发布,到 2019 年迅速成为了 W3C 的官方标准,它包括一种人类可读的 .wat 文本格式语言,然后将其转换为浏览器可以运行的二进制 .wasm 格式,这就使得我们可以用任何语言编写代码,将其编译为 WebAssembly,然后在网络浏览器中运行。

如何使用 PyScript?

PyScript 的 alpha 版本可以在 pyscript.net 上找到,代码可在 https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712github.comhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pyscript 获得。PyScript 允许你使用以下三个主要组件在 html 中编写 Python:

  • 定义了运行 Python 代码所需的 Python 包。
  • 是你编写在网页中执行的 Python 代码的地方。
  • 创建一个 REPL 组件,用于评估用户输入的代码并显示结果。

    我们先创建一个最简单的示例,代码如下所示:

    
    
    
    
    
    PyScript Hello World<https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712title>
    
    <link rel="icon" type="imagehttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712png" href="favicon.png" https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712>
    <link rel="stylesheet" href="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pyscript.nethttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712alphahttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pyscript.css" https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712>
    <script defer src="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pyscript.nethttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712alphahttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pyscript.js"><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712script>
    <https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712head>
    <body>
    Hello world! <br https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712>
    This is the current date and time, as computed by Python:
    <py-script>
    from datetime import datetime
    now = datetime.now()
    now.strftime("%mhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712%dhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712%Y, %H:%M:%S")
    <https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712py-script>
    <https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712body>
    <https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712html><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pre><p >只需要这页面上显示当前时间即可,在浏览器中打开后就可以看到结果了,如下所示:<https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712p><p  style="text-align: center;"><img src="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712img.php.cnhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712uploadhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712articlehttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712000https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712465https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712014https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712168233119092064.png" alt="什么?可以在 HTML 中直接插入 Python 代码?" https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712p><p >又比如我们创建一个具有流式数据的 Panel 仪表盘,代码如下所示,先通过 引入需要的包,然后在 中编写 Python 代码,如果你不喜欢直接在下编写 Python 代码,也可以使用 Python 文件作为源代码,例如。<https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712p><pre class="brush:typescript;toolbar:false;"><!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <link rel="icon" type="imagehttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712x-icon" href=".https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712favicon.png">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta name="theme-color" content="#000000">
    <meta name="name" content="PyScripthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712Panel Streaming Demo">
    <title>PyScripthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712Panel Streaming Demo<https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712title>
    <link rel="icon" type="imagehttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712x-icon" href=".https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712favicon.ico">
    <link rel="stylesheet" href="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712cdnjs.cloudflare.comhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712ajaxhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712libshttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712font-awesomehttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd837125.15.3https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712csshttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712all.min.css" type="texthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712css" https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712>
    <link rel="stylesheet" href="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712unpkg.comhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712@holovizhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712panel@0.13.0https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712disthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712csshttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712widgets.css" type="texthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712css" https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712>
    <link rel="stylesheet" href="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712unpkg.comhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712@holovizhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712panel@0.13.0https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712disthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712csshttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712markdown.css" type="texthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712css" https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712>
    <script type="texthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712javascript" src="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712unpkg.comhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712tabulator-tables@4.9.3https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712disthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712jshttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712tabulator.js"><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712script>
    <script type="texthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712javascript" src="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712cdn.bokeh.orghttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bokehhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712releasehttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bokeh-2.4.2.js"><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712script>
    <script type="texthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712javascript" src="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712cdn.bokeh.orghttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bokehhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712releasehttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bokeh-widgets-2.4.2.min.js"><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712script>
    <script type="texthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712javascript" src="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712cdn.bokeh.orghttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bokehhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712releasehttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bokeh-tables-2.4.2.min.js"><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712script>
    <script type="texthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712javascript" src="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712unpkg.comhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712@holovizhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712panel@0.13.0https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712disthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712panel.min.js"><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712script>
    <script type="texthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712javascript">
    Bokeh.set_log_level("info");
    <https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712script>
    <link rel="stylesheet" href="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712cdn.jsdelivr.nethttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712npmhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bootstrap@4.6.1https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712disthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712csshttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bootstrap.min.css">
    <link rel="stylesheet" href="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712unpkg.comhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712@holovizhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712panel@0.13.0https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712disthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bundledhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bootstraptemplatehttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bootstrap.css">
    <link rel="stylesheet" href="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712unpkg.comhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712@holovizhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712panel@0.13.0https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712disthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bundledhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712defaultthemehttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712default.css">
    <script src="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712cdn.jsdelivr.nethttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712npmhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712jquery@3.5.1https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712disthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712jquery.slim.min.js"><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712script>
    <script src="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712cdn.jsdelivr.nethttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712npmhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bootstrap@4.6.1https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712disthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712jshttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712bootstrap.bundle.min.js"><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712script>
    <link rel="stylesheet" href="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pyscript.nethttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712alphahttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pyscript.css" https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712>
    <script defer src="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pyscript.nethttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712alphahttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pyscript.js"><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712script>
    <https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712head>
    <py-env>
    - bokeh
    - numpy
    - pandas
    - panel
    <https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712py-env>
    <body>
    
    <nav   style="background-color: #000000;">
    <button type="button"  >
     <span ><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712span>
     <https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712button>
     
     
     <img src="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712img.php.cnhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712uploadhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712articlehttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712000https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712465https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712014https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712168233119095196.png" alt="什么?可以在 HTML 中直接插入 Python 代码?" https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712>
     <https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712a>
     Panel Streaming Demo<https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712a>
     
    <https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712nav>
    
    
    
    
    
    
    
    
    
    
    <py-script>
    import asyncio
    import panel as pn
    import numpy as np
    import pandas as pd
    from bokeh.models import ColumnDataSource
    from bokeh.plotting import figure
    from panel.io.pyodide import show
    df = pd.DataFrame(np.random.randn(10, 4), columns=list('ABCD')).cumsum()
    rollover = pn.widgets.IntInput(name='Rollover', value=15)
    follow = pn.widgets.Checkbox(name='Follow', value=True, align='end')
    
    tabulator = pn.widgets.Tabulator(df, height=450, width=400)
    
    def color_negative_red(val):
    """
    Takes a scalar and returns a string with
    the css property `'color: red'` for negative
    strings, black otherwise.
    """
    color = 'red' if val < 0 else 'green'
    return 'color: %s' % color
    tabulator.style.applymap(color_negative_red)
    p = figure(height=450, width=600)
    cds = ColumnDataSource(data=ColumnDataSource.from_df(df))
    p.line('index', 'A', source=cds, line_color='red')
    p.line('index', 'B', source=cds, line_color='green')
    p.line('index', 'C', source=cds, line_color='blue')
    p.line('index', 'D', source=cds, line_color='purple')
    def stream():
    data = df.iloc[-1] + np.random.randn(4)
    tabulator.stream(data, rollover=rollover.value, follow=follow.value)
    value = {k: [v] for k, v in tabulator.value.iloc[-1].to_dict().items()}
    value['index'] = [tabulator.value.index[-1]]
    cds.stream(value)
    cb = pn.state.add_periodic_callback(stream, 200)
    controls = pn.Row(cb.param.period, rollover, follow, width=400)
    await show(controls, 'controls')
    await show(tabulator, 'table')
    await show(p, 'plot')
    <https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712py-script>
    <https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712body>
    <https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712html><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pre><p >上面的代码在浏览器中打开后就可以直接显示对应的效果了:<https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712p><p  style="text-align: center;"><img src="https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712img.php.cnhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712uploadhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712articlehttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712000https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712465https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712014https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712168233119361962.gif" alt="什么?可以在 HTML 中直接插入 Python 代码?" https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712><https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712p><p >关于 PyScript 的更多使用方法可以查看 Git 仓库示例 https:https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712github.comhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pyscripthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pyscripthttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712treehttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712mainhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712pyscriptjshttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712examples 了解更多。<https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712p><p>以上就是HTML 中可以嵌入 Python 代码吗?的详细内容,转载自php中文网</p></span>                        </p>
                            <!-- E 正文 -->
                        </div>
    
                        <!-- S 付费阅读 -->
    <!-- E 付费阅读 -->
    
    
                        <!-- S 点赞 -->
    <div class="article-donate">
        <a href="javascript:" class="btn btn-primary btn-like btn-lg" data-action="vote" data-type="like" data-id="15544" data-tag="archives"><i class="fa fa-thumbs-up"></i> 点赞(<span>443</span>)</a>
            <a href="javascript:" class="btn btn-outline-primary btn-donate btn-lg" data-action="donate" data-id="15544" data-image="/uploads/20211126/1493fe043a53a9aea7b63d8fbe0dfe36.png"><i class="fa fa-cny"></i> 打赏</a>
        </div>
    <!-- E 点赞 -->
    
    
                        
    
    <!-- S 分享 -->
    <div class="social-share text-center mt-2 mb-1" data-initialized="true" data-mode="prepend" data-image="https://www.php.cn/https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712https://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712img.php.cnhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd83712uploadhttps://www.php.cn/link/29a9f8c8460e5e2be4edde557fd8">
        <a href="javascript:" class="social-share-icon icon-heart addbookbark" data-type="archives" data-aid="15544" data-action="/addons/cms/ajax/collection.html"></a>
        <a href="#" class="social-share-icon icon-weibo" target="_blank"></a>
        <a href="#" class="social-share-icon icon-qq" target="_blank"></a>
        <a href="#" class="social-share-icon icon-qzone" target="_blank"></a>
        <a href="javascript:" class="social-share-icon icon-wechat"></a>
    </div>
    <!-- E 分享 -->
    
    
                        <div class="entry-meta">
        <ul>
            <!-- S 归档 -->
            <li>本文分类:<a href="/python.html">python</a></li>
            <li>本文标签:<a href="/t/php.html" class="tag" rel="tag">php</a></li>
            <li>浏览次数:<span>129</span> 次浏览</li>
            <li>发布日期:2023-04-25 09:25:35</li>
            <li>本文链接:<a href="https://yinghuohong.cn/python/15544.html">https://yinghuohong.cn/python/15544.html</a></li>
            <!-- S 归档 -->
        </ul>
    
        <ul class="article-prevnext">
            <!-- S 上一篇下一篇 -->
                    <li>
                <span>上一篇 ></span>
                <a href="/python/15543.html">Python函数的实现原理是什么</a>
            </li>
                    <li>
                <span>下一篇 ></span>
                <a href="/python/15545.html">如何使用Python代码创建复杂的财务图表?</a>
            </li>
                    <!-- E 上一篇下一篇 -->
        </ul>
    </div>
    
    
    
                        <div class="related-article">
        <div class="row">
            <!-- S 相关文章 -->
                    <div class="col-sm-3 col-xs-6">
                <a href="/phpjichu/19708.html" class="img-zoom">
                    <div class="embed-responsive embed-responsive-4by3">
                        <img src="https://baitexiaoyuan.oss-cn-zhangjiakou.aliyuncs.com/updatecrm/php/5303cfb65a0646ff94215a13192607a0.png" alt="PHP实现在线进制转换器,10进制,2、4、8、16、32进制转换" class="embed-responsive-item">
                    </div>
                </a>
                <h5 class="text-center"><a href="/phpjichu/19708.html">PHP实现在线进制转换器,10进制,2、4、8、16、32进制转换</a></h5>
            </div>
                    <div class="col-sm-3 col-xs-6">
                <a href="/phpjichu/19692.html" class="img-zoom">
                    <div class="embed-responsive embed-responsive-4by3">
                        <img src="https://baitexiaoyuan.oss-cn-zhangjiakou.aliyuncs.com/updatecrm/php/f83b735122ec40e6b707cb70170f6320.png" alt="fileclude(文件包含漏洞及php://input、php://filter的使用)" class="embed-responsive-item">
                    </div>
                </a>
                <h5 class="text-center"><a href="/phpjichu/19692.html">fileclude(文件包含漏洞及php://input、php://filter的使用)</a></h5>
            </div>
                    <div class="col-sm-3 col-xs-6">
                <a href="/phpjichu/16513.html" class="img-zoom">
                    <div class="embed-responsive embed-responsive-4by3">
                        <img src="https://yinghuohong.cn/uploads/20220423/acd550209a0546fb61ca005d169b622e.jpg" alt="PHP 对银行卡,手机号,真实姓名,身份证进行掩码加星号处理" class="embed-responsive-item">
                    </div>
                </a>
                <h5 class="text-center"><a href="/phpjichu/16513.html">PHP 对银行卡,手机号,真实姓名,身份证进行掩码加星号处理</a></h5>
            </div>
                    <div class="col-sm-3 col-xs-6">
                <a href="/phpjichu/16512.html" class="img-zoom">
                    <div class="embed-responsive embed-responsive-4by3">
                        <img src="https://baitexiaoyuan.oss-cn-zhangjiakou.aliyuncs.com/updatecrm/php/a8d8fe7190ea4592b1c8fa09a28b2319.png" alt="悟空CRM11.0 PHP版本docker容器化部署全流程" class="embed-responsive-item">
                    </div>
                </a>
                <h5 class="text-center"><a href="/phpjichu/16512.html">悟空CRM11.0 PHP版本docker容器化部署全流程</a></h5>
            </div>
                    <!-- E 相关文章 -->
        </div>
    </div>
    
    
                        <div class="clearfix"></div>
    
                    </div>
                </div>
    
                            <div class="panel panel-default" id="comments">
                    <div class="panel-heading">
                        <h3 class="panel-title">评论列表                        <small>共有 <span>0</span> 条评论</small>
                        </h3>
                    </div>
                    <div class="panel-body">
                                            <div id="comment-container">
        <!-- S 评论列表 -->
        <div id="commentlist">
                    <div class="loadmore loadmore-line loadmore-nodata"><span class="loadmore-tips">暂无评论</span></div>
                </div>
        <!-- E 评论列表 -->
    
        <!-- S 评论分页 -->
        <div id="commentpager" class="text-center">
                </div>
        <!-- E 评论分页 -->
    
        <!-- S 发表评论 -->
        <div id="postcomment">
            <h3>发表评论 <a href="javascript:;">
                <small>取消回复</small>
            </a></h3>
            <form action="/addons/cms/comment/post.html" method="post" id="postform">
                <input type="hidden" name="__token__" value="dc134ff5976a9e256031c81c484890cb" />            <input type="hidden" name="type" value="archives"/>
                <input type="hidden" name="aid" value="15544"/>
                <input type="hidden" name="pid" id="pid" value="0"/>
                <div class="form-group">
                    <textarea name="content" class="form-control" disabled placeholder="请登录后再发表评论"  id="commentcontent" cols="6" rows="5" tabindex="4"></textarea>
                </div>
                            <div class="form-group">
                    <a href="/index/user/login.html" class="btn btn-primary">登录</a>
                    <a href="/index/user/register.html" class="btn btn-outline-primary">注册新账号</a>
                </div>
                        </form>
        </div>
        <!-- E 发表评论 -->
    </div>
    
                                        </div>
                </div>
                
            </main>
    
            <aside class="col-xs-12 col-md-4">
                <!--@formatter:off-->
    <!-- S 关于作者 -->
    <div class="panel panel-default about-author no-padding" data-id="1" itemProp="author" itemscope="" itemType="http://schema.org/Person">
        <meta itemProp="name" content="萤火虫"/>
        <meta itemProp="image" content="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgaGVpZ2h0PSIxMDAiIHdpZHRoPSIxMDAiPjxyZWN0IGZpbGw9InJnYigxOTcsMjI5LDE2MCkiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj48L3JlY3Q+PHRleHQgeD0iNTAiIHk9IjUwIiBmb250LXNpemU9IjUwIiB0ZXh0LWNvcHk9ImZhc3QiIGZpbGw9IiNmZmZmZmYiIHRleHQtYW5jaG9yPSJtaWRkbGUiIHRleHQtcmlnaHRzPSJhZG1pbiIgZG9taW5hbnQtYmFzZWxpbmU9ImNlbnRyYWwiPuiQpDwvdGV4dD48L3N2Zz4="/>
        <meta itemProp="url" content="/u/1"/>
        <div class="panel-body no-padding">
            <div class="author-card">
                <div class="author-head" style="background-image:url('/assets/addons/cms/img/author-head.jpeg');"></div>
    
                <div class="author-avatar">
                    <a href="/u/1">
                        <img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgaGVpZ2h0PSIxMDAiIHdpZHRoPSIxMDAiPjxyZWN0IGZpbGw9InJnYigxOTcsMjI5LDE2MCkiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj48L3JlY3Q+PHRleHQgeD0iNTAiIHk9IjUwIiBmb250LXNpemU9IjUwIiB0ZXh0LWNvcHk9ImZhc3QiIGZpbGw9IiNmZmZmZmYiIHRleHQtYW5jaG9yPSJtaWRkbGUiIHRleHQtcmlnaHRzPSJhZG1pbiIgZG9taW5hbnQtYmFzZWxpbmU9ImNlbnRyYWwiPuiQpDwvdGV4dD48L3N2Zz4=">
                    </a>
                </div>
    
                <div class="author-basic">
                    <div class="author-nickname">
                        <a href="/u/1">萤火虫</a>
                    </div>
                    <span class="text-muted">这家伙很懒,什么也没写!</span>
                </div>
    
                <div class="row author-statistics">
                    <div class="col-xs-4">
                        <div class="statistics-text">文章</div>
                        <div class="statistics-nums"><a href="/u/1/archives">86295</a></div>
                    </div>
                    <div class="col-xs-4">
                        <div class="statistics-text">评论</div>
                        <div class="statistics-nums"><a href="/u/1/comment">0</a></div>
                    </div>
                    <div class="col-xs-4">
                        <div class="statistics-text">加入时间</div>
                        <div class="statistics-nums">7年前</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- E 关于作者 -->
    <!--@formatter:on-->
    
                
    <div class="panel panel-blockimg">
        <a href="https://www.baidu.com" target="_blank">
        <img src="https://picsum.photos/id/206/720/300" class="img-responsive">
    </a></div>
    
    <!-- S 热门资讯 -->
    <div class="panel panel-default hot-article">
        <div class="panel-heading">
            <h3 class="panel-title">推荐资讯</h3>
        </div>
        <div class="panel-body">
                </div>
    </div>
    <!-- E 热门资讯 -->
    
    <div class="panel panel-blockimg">
        <a href="https://www.baidu.com" target="_blank">
        <img src="https://picsum.photos/id/320/720/600" class="img-responsive" alt="">
    </a></div>
    
    <!-- S 热门标签 -->
    <div class="panel panel-default hot-tags">
        <div class="panel-heading">
            <h3 class="panel-title">热门标签</h3>
        </div>
        <div class="panel-body">
            <div class="tags">
                            <a href="/t/VR.html" class="tag"> <span>VR</span></a>
                            <a href="/t/音频录制.html" class="tag"> <span>音频录制</span></a>
                            <a href="/t/使用技巧.html" class="tag"> <span>使用技巧</span></a>
                            <a href="/t/对象.html" class="tag"> <span>对象</span></a>
                            <a href="/t/压缩技术.html" class="tag"> <span>压缩技术</span></a>
                            <a href="/t/动态布局.html" class="tag"> <span>动态布局</span></a>
                            <a href="/t/json.html" class="tag"> <span>json</span></a>
                            <a href="/t/jquery.html" class="tag"> <span>jquery</span></a>
                            <a href="/t/视频下载.html" class="tag"> <span>视频下载</span></a>
                            <a href="/t/样式表.html" class="tag"> <span>样式表</span></a>
                            <a href="/t/Integer.html" class="tag"> <span>Integer</span></a>
                            <a href="/t/开发语言.html" class="tag"> <span>开发语言</span></a>
                            <a href="/t/JS.html" class="tag"> <span>JS</span></a>
                            <a href="/t/position.html" class="tag"> <span>position</span></a>
                            <a href="/t/php7.html" class="tag"> <span>php7</span></a>
                            <a href="/t/Python.html" class="tag"> <span>Python</span></a>
                            <a href="/t/日期.html" class="tag"> <span>日期</span></a>
                            <a href="/t/事件.html" class="tag"> <span>事件</span></a>
                            <a href="/t/display.html" class="tag"> <span>display</span></a>
                            <a href="/t/Resource.html" class="tag"> <span>Resource</span></a>
                            <a href="/t/macos.html" class="tag"> <span>macos</span></a>
                            <a href="/t/异步加载.html" class="tag"> <span>异步加载</span></a>
                            <a href="/t/padding.html" class="tag"> <span>padding</span></a>
                            <a href="/t/找活.html" class="tag"> <span>找活</span></a>
                            <a href="/t/宏基.html" class="tag"> <span>宏基</span></a>
                            <a href="/t/javascript.html" class="tag"> <span>javascript</span></a>
                            <a href="/t/互联网+.html" class="tag"> <span>互联网+</span></a>
                            <a href="/t/互联网.html" class="tag"> <span>互联网</span></a>
                            <a href="/t/运算符.html" class="tag"> <span>运算符</span></a>
                            <a href="/t/excel.html" class="tag"> <span>excel</span></a>
                        </div>
        </div>
    </div>
    <!-- E 热门标签 -->
    
    <!-- S 推荐下载 -->
    <div class="panel panel-default recommend-article">
        <div class="panel-heading">
            <h3 class="panel-title">推荐下载</h3>
        </div>
        <div class="panel-body">
                </div>
    </div>
    <!-- E 推荐下载 -->
    
    <div class="panel panel-blockimg">
        <a href="https://www.baidu.com" target="_blank">
        <img src="https://picsum.photos/id/381/720/600" class="img-responsive">
    </a></div>
    
            </aside>
        </div>
    </div>
    
    </main>
    
    <footer>
        <div id="footer">
            <div class="container">
                <div class="row footer-inner">
                    <div class="col-xs-12">
                        <div class="footer-logo pull-left mr-4">
                            <a href="/"><i class="fa fa-bookmark"></i></a>
                        </div>
                        <div class="pull-left">
                            Copyright © 2024 All rights reserved. 萤火红程序交流平台                        <a href="https://beian.miit.gov.cn" target="_blank">豫ICP备2021034241号-1</a>
    
                        <ul class="list-unstyled list-inline mt-2">
                            <li><a href="/p/aboutus.html">关于我们</a></li>
    <!--                        <li><a href="/p/agreement.html">用户协议</a></li>-->
    <!--                        -->
    <!--                        <li><a href="/index/user/index.html">会员中心</a></li>-->
    <!--                        -->
                        </ul>
                        </div>
    
                    </div>
                </div>
            </div>
        </div>
    </footer>
    
    <div id="floatbtn">
        <!-- S 浮动按钮 -->
    
            <a href="javascript:;">
            <i class="iconfont icon-wxapp"></i>
            <div class="floatbtn-wrapper">
                <div class="qrcode"><img src="/assets/addons/cms/img/qrcode.png"></div>
                <p>微信小程序</p>
                <p>微信扫一扫体验</p>
            </div>
        </a>
            <a class="hover" href="/index/cms.archives/post.html" target="_blank">
            <i class="iconfont icon-pencil"></i>
            <em>立即<br>投稿</em>
        </a>
        
        <div class="floatbtn-item floatbtn-share">
            <i class="iconfont icon-share"></i>
            <div class="floatbtn-wrapper" style="height:50px;top:0">
                <div class="social-share" data-initialized="true" data-mode="prepend">
                    <a href="#" class="social-share-icon icon-weibo" target="_blank"></a>
                    <a href="#" class="social-share-icon icon-qq" target="_blank"></a>
                    <a href="#" class="social-share-icon icon-qzone" target="_blank"></a>
                    <a href="#" class="social-share-icon icon-wechat"></a>
                </div>
            </div>
        </div>
    
            <a href="javascript:;">
            <i class="iconfont icon-qrcode"></i>
            <div class="floatbtn-wrapper">
                <div class="qrcode"><img src="/assets/addons/cms/img/qrcode.png"></div>
                <p>微信公众账号</p>
                <p>微信扫一扫加关注</p>
            </div>
        </a>
            <a id="feedback" class="hover" href="#comments">
            <i class="iconfont icon-feedback"></i>
            <em>发表<br>评论</em>
        </a>
        
        <a id="back-to-top" class="hover" href="javascript:;">
            <i class="iconfont icon-backtotop"></i>
            <em>返回<br>顶部</em>
        </a>
        <!-- E 浮动按钮 -->
    </div>
    
    
    <script type="text/javascript" src="/assets/libs/jquery/dist/jquery.min.js?v=1.0.10"></script>
    <script type="text/javascript" src="/assets/libs/bootstrap/dist/js/bootstrap.min.js?v=1.0.10"></script>
    <script type="text/javascript" src="/assets/libs/fastadmin-layer/dist/layer.js?v=1.0.10"></script>
    <script type="text/javascript" src="/assets/libs/art-template/dist/template-native.js?v=1.0.10"></script>
    <script type="text/javascript" src="/assets/addons/cms/js/jquery.autocomplete.js?v=1.0.10"></script>
    <script type="text/javascript" src="/assets/addons/cms/js/swiper.min.js?v=1.0.10"></script>
    <script type="text/javascript" src="/assets/addons/cms/js/share.min.js?v=1.0.10"></script>
    <script type="text/javascript" src="/assets/addons/cms/js/cms.js?v=1.0.10"></script>
    
    
    <script type="text/javascript" src="/assets/addons/cms/js/common.js?v=1.0.10"></script>
    
    </body>
    </html>