Save data from toggle console as txt or other format


I made python scripting and wanna save those result displayed in the toggle console as txt or other format.

Does anyone come up with any idea??




python can read/write files
make your data to be output to a file

Run Blender from a console (yes, even in Windows you can do so :slight_smile:
do it: blender.exe 1>output.txt 2>errors.txt

All the output from Blender will be saved in output.txt while eventual errors in the software should go to errors.txt (although I believe Blender may be outputting only to the standard output (1)).

The same is valid for linux or osx.

Hi, thanks for your idea, but can you give me one example??


dfelinto gave you an example above. 1> redirects stdout (standard output) and 2> redirects stderr (all errors). So you end up with 2 files in the current directory: output.txt and errors.txt.

But my sys.stdout shows <_io.StringIO object at 0x00000000094CA7C8> instead of all the position i have printed out in Python.:S Because my output is generated every frame, what has been saved in the file was just one line not all.


Does anyone know why??