【问题标题】:Nothing is printed out from the command line using Gimp使用 Gimp 不会从命令行打印任何内容
【发布时间】:2021-12-13 05:14:56
【问题描述】:

它说“批处理命令执行成功”,但命令行上没有打印任何内容。我错过了什么吗?我正在使用 Windows。

gimp-console-2.10.exe -idf --batch-interpreter python-fu-eval -b "import test; test.main(\"print this out\")"

文件名为test.py

#!/usr/bin/env python
from gimpfu import *

def main(mystring):
    print(mystring)

【问题讨论】:

  • 我不确定转义字符 \ 在 Windows 上是如何工作的。尝试将数字而不是 str 传递给 main。或者尝试将 print(1) 作为 -b 参数传递

标签: python cmd printing arguments gimp


【解决方案1】:

您无法在 Windows 上打印到控制台 - 它会被缓冲,然后在缓冲区已满时挂起。

在此处查看替代方案:https://www.gimp-forum.net/Thread-Debugging-python-fu-scripts-in-Windows

【讨论】:

    猜你喜欢
    • 2020-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-14
    • 1970-01-01
    • 1970-01-01
    • 2021-08-23
    • 2020-11-23
    相关资源
    最近更新 更多