Search on blog:

Manim: How to run Manim code easier

In documentation you can see that you can run manim code in console

manim -p -ql Scene1 Scene2 Scene3


-p        :preview after rendering
-ql       :quality low :file with manim code
Scene     :class name(s) in manim code

To make life easier you can run it directly in code using subproceesing.

if __name__ == '__main__':
    import subprocess['manim', '-p', '-ql', __file__, 'Scene1', 'Scene2', 'Scene3'])

Or you can use function manim.main() for this

if __name__ == '__main__':
    import sys
    from manim.__main__ import main

    #sys.argv = ['manim', '--help']
    sys.argv = ['manim', '-p', '-ql', __file__, 'Scene1', 'Scene2', 'Scene3']


If you like it
Buy a Coffee