提问人:artsem krupenko 提问时间:10/25/2023 更新时间:10/25/2023 访问量:44
from panel.io.pyodide import show 已过时
from panel.io.pyodide import show is obsolete
问:
有一个有效的pyscript代码,它使用了“panel.io.pyodide”库中的“show”函数。更新面板 24.10.23 后,代码停止工作。我是python的新手。也许有人可以帮助我
` Bokeh.set_log_level(“信息”);
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<py-env>
- numpy
- pandas
- panel==0.13.1a2
</py-env>
上传 csv
<div id="fileinput"></div>
<div id="upload"></div>
<div id="table"></div>
<py-script>
import asyncio
import panel as pn
import pandas as pd
from panel.io.pyodide import show
fileInput = pn.widgets.FileInput(accept='.csv')
uploadButton = pn.widgets.Button(name='Upload', button_type = 'primary')
table = pn.widgets.Tabulator(pagination='remote', page_size=10)
document.getElementById('table').style.display = 'none'
def process_file(event):
if fileInput.value is not None:
table.value = pd.read_csv(io.BytesIO(fileInput.value))
document.getElementById('table').style.display = 'block'
uploadButton.on_click(process_file)
await show(fileInput, 'fileinput')
await show(uploadButton, 'upload')
await show(table, 'table')
`
我尝试在此处更改版本 - 它没有帮助。我希望有人能告诉我现在如何导入show函数以使此代码再次工作
答: 暂无答案
评论
from
alpha
https://pyscript.net/releases/2023.05.1/pyscript.js