小编Hit*_*Roy的帖子

如何使用 python 脚本将 JSON 数据转换为 PDF

我想将从 API 获取的 JSON 数据转换为 PDF。

JSON数据示例

{
    "data": [
        {
            "state": "Manchester",
            "quantity": 20
        },
        {
            "state": "Surrey",
            "quantity": 46
        },
        {
            "state": "Scotland",
            "quantity": 36
        },
        {
            "state": "Kent",
            "quantity": 23
        },
        {
            "state": "Devon",
            "quantity": 43
        },
        {
            "state": "Glamorgan",
            "quantity": 43
        }
     ]   
}
Run Code Online (Sandbox Code Playgroud)

我找到了这个脚本: http://code.activestate.com/recipes/578979-convert-json-to-pdf-with-python-and-xtopdf/

但出现错误

无模块 PDFWriter

有没有其他方法可以将 JSON 数据转换为 PDF。

请帮忙。

python pdf json

7
推荐指数
1
解决办法
3万
查看次数

气流的Web服务器没有运行

在Django的Airflow中配置电子邮件调度程序,但它不起作用.

终端错误:

airflow webserver
[2017-12-29 10:52:17,614] {__init__.py:57} INFO - Using executor SequentialExecutor
[2017-12-29 10:52:17,734] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.5/lib2to3/Grammar.txt
[2017-12-29 10:52:17,765] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
  ____________       _____________
 ____    |__( )_________  __/__  /________      __
____  /| |_  /__  ___/_  /_ __  /_  __ \_ | /| / /
___  ___ |  / _  /   _  __/ _  / / /_/ /_ |/ |/ /
 _/_/  |_/_/  /_/    /_/    /_/  \____/____/|__/

/usr/local/lib/python3.5/dist-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.cache …
Run Code Online (Sandbox Code Playgroud)

django python-3.x apache-airflow airflow-scheduler

4
推荐指数
1
解决办法
4100
查看次数