python - 在 Python 中解析查询字符串中的字典?
问题描述
像这样编码查询字符串是相当标准的:
urlencode({
'a': {
'b': 1
},
})
# a[b]=1
然而:
parse_qs('a[b]=1')
# {'a[b]': 1}
Python 是否有内置函数来解析包含 dicts 的查询字符串?如果没有,那么干净的方法是什么?
解决方案
推荐阅读
- r - 当已经使用 col.region 时,有没有办法在 lattice 包的 levelplot 函数中自定义颜色?
- flutter - Flutter Geolocator Location 不适用于真实手机
- treeview - Forge Viewer v7* 中的 SELECTION_CHANGED_EVENT 问题
- c++ - sscanf 的行为突然不同了
- c# - UWP - 默认语言是阿拉伯语 (ar-sa),但运行时是英国 (en-GB)
- python - 如何将字符串列表转换为字典列表?
- c++ - 为什么在包含 iostream 时可以使用 printf()?
- react-admin - 如何在 List 组件中使用相关的过滤器?
- arrays - 使用动态转换从表创建 postgres 视图
- c++ - 如何在 C++ Builder 下调试外部进程?