python - Python:使用获取参数调用 Dash 应用程序
问题描述
我想创建一个可以访问在地址中传递的参数的破折号应用程序。例如,http://localhost:5050?config=bob.json
@app.callback(
dash.dependencies.Output('funnel-graph', 'figure'),
[dash.dependencies.Input('Manager', 'value')])
def update_graph(Manager):
config = ... # get config value of 'bob.json'
...
解决方案
您可以使用dcc.location提取所需的任何参数值来访问完整的地址行。
推荐阅读
- android - 如何实现像Uber Eats Food Menu滚动这样的滚动功能
- android - Playstore 提示“声明敏感权限”
- android - AndroidManifest.xml 不存在或 React Native 的根标签不正确
- c# - 无法通过 XPO 在 C# 代码中连接到 Postgres 数据库
- vue.js - 用 cypress 测试 vuex
- networking - 子域如何解析为 IP 地址?
- python - 如何在 Python 中去除异常值?
- php - PHP 在本地 WAMP 服务器上不使用 SMTP 发送邮件
- java - 如何将列表数据报告到文件excel?
- mysql - MySQL JOIN 查询 - 左表的每一行从右表中提取一行,并优先考虑包含的数据