The original question was posted on Reddit (https://www.reddit.com/r/manim/comments/lw3xs7/is_it_possible_to_run_manim_programmatically_and/). I took the liberty to ask it here.
Say I want to code a simple GUI application, where a user can enter LaTeX code, click on an "animate" button, then manim renders an mp4 in the background, and finally, the animation is presented to the user.
Is it possible to use manim as a module to achieve this? For example by inserting the user input in a previously prepared manim scene, then calling something like my_scene.run(output=tempfile.mp4)
? Or would I have to take the user input, write it into a new scene.py file and run os.subprocess("manim", "scene.py", "MyScene", "-p")
?