Print console logs in terminal
Rage last edited by a_block
I'm developing an application that runs a python plugin in cinema4d from commandline. Here's the problem: I can't see the console prints. How do I make c4d to print the logs in the terminal console instead of its own (the internal one under script->console)?
Are you using Cinema 4D release 20 commandline.app/exe? There's a known bug under investigation.
The workaround is to use
There's a more convenient workaround than using
sys.__stdout__original standard output stream can be used to redirect stdout and print to the terminal/console. Here's some code:
# Stores the stdout redirected by Cinema 4D Python c4d_stdout = sys.stdout # Redirects to original stdout sys.stdout = sys.__stdout__ # Prints something print("Some text to be printed to the terminal/console") # Restores Cinema 4D Python stdout redirection sys.stdout = c4d_stdout
Rage last edited by
Thank you this works nicecly
I'm using cinema 4D 20 student edition
As I turned this discussion into a Q&A topic, if you're satisfied with my last post's solution then you can mark it as the correct answer or mark the topic as solved.
For more information see Q&A New Functionality.