2
$\begingroup$

I'm looking for a simple text-print setup where I can see multiple text outputs (multiple lines of text), similar to writing to a text file while ending every statement with an end-of-line.

A simple global function, such as PrintDebug(text), which any code in my project can execute to show progress and stages of execution. Honestly, I expected the standard print() to do this. Where does print() print to?

Is there any built-in functionality to do this, or possibly a simple way to set this up?

$\endgroup$
4
  • 3
    $\begingroup$ Where do you want the output to appear? print() works, the output goes to stdout. Your terminal, console, command line will display the text, if you started Blender from it. $\endgroup$
    – Robert Gützkow
    Sep 10, 2019 at 13:59
  • $\begingroup$ Preferrably into one of the Blender windows if possible, but any accessible area would be great, as long as I can see all of the lines that got printed. I start Blender from a shortcut on the desktop, and the console window disappears after Blender starts. I've never tried to execute from a console. Will try that when I get home, thanks. $\endgroup$
    – Robert
    Sep 10, 2019 at 16:30
  • 1
    $\begingroup$ If you're on Windows then you can toggle the console through Window > Toggle System Console in Blender. $\endgroup$
    – Robert Gützkow
    Sep 10, 2019 at 18:25
  • $\begingroup$ This helped me tremendously. There are many errors shown in here that never make it to the info window in Blender. It explains a lot of missing details. I was able to resolve an issue in a few minutes that I face palmed over for 3 hours yesterday. $\endgroup$
    – Robert
    Sep 10, 2019 at 19:58

1 Answer 1

1
$\begingroup$

You can use bpy.ops.wm.console_toggle() to display the console, and then you can print using the print() method.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .