Hi again ;),
what do you mean by "python script" here, a Script manager script or c4dpy
?
For the latter you can use os.execl
, which will run whatever you are passing to it in a new interpreter. There are many threads on this topic on stack-overflow, but there is no sane way to ensure that the first interpreter actually closes while second one runs. An easier solution would be to just stack two scripts in your os-dependent script language (i.e. a batch file in Windows).
If you want to close the GUI-app, I am afraid there is no command for that because of the security implications (how to handle unsaved content?), you could wiggle your way around it by getting the handle of the Cinema window, but the problem on how to handle unsaved content would remain.
If it is only garbage collection you are after, you could also use Python's gc
module to halt your script until the garbage collector thinks it is done. But Cinema is sort of a special case due to the way its API is constructed, which can cause stuff to linger for quite a while, even if when you think you have removed all references.
Cheers,
zipit