On 07/09/2015 at 03:09, xxxxxxxx wrote:
Hi! I want to close Cinema 4D (ideally with a specific exit code) from Python, and I'd prefer to use
an OS or C4D API function, but nothing but the system command works. What would be interesting
to be especially is why Cinema just freezes instead quitting or continuing to function properly.
sys.exit(1) # sys.exit() not allowed from embedded application
os._exit(1) # Cinema freezes
ctypes.windll.kernel32.ExitProcess(1) # Cinema freezes
os.system('taskkill /PID %d' % os.getpid()) # That kind of works but I can't set the exit code
Tested on R16.