gpt4 book ai didi

python - 有没有可能如何在 Scribus 之外的 python 中使用 scribus 模块?

转载 作者:行者123 更新时间:2023-11-28 16:38:40 24 4
gpt4 key购买 nike

我想使用 Scribus 和 python 脚本生成 pdf 文件。我一直在环顾四周,只发现了在 Scirbus 中使用 scribus 模块的 python 脚本示例。以及这些脚本中的注释,即

"This Python script is written for the Scribus scripting interface. 
It can only be run from within Scribus."

当我使用命令时

import scribus

在python中,出现错误ImportError: No module named 'scribus'。但是当我在 Scribus 的 python 控制台中使用这个命令时,一切正常,我可以使用这个模块。那么,我在哪里可以找到这个模块?

或者我可以将输入参数作为 python 脚本来运行 Scribus 吗?有点像

scribus python_script.py

我同时使用 linux 和 windows,所以在其中一个操作系统中的解决方案会很棒。

Python 3.3.2 &Scribus 1.4.3

最佳答案

事实上,您可以将 python 脚本作为参数传递给 scribus。但据我所知,这只适用于 1.5 版

示例来自 scribus wiki

# only one short flag  + scribus doesnt open a document (the script itself does it)
scribus -py somescript.py --python-arg v

关于python - 有没有可能如何在 Scribus 之外的 python 中使用 scribus 模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22467896/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com