A community-maintained Python framework for creating mathematical animations.
Allow the user to type manim code when using - as filename.
Aathish Sivasubrahmanian293ee1940aea
diff --git a/manim/__main__.py b/manim/__main__.pyindex 63f7bebba..0bd7225e5 100644--- a/manim/__main__.py+++ b/manim/__main__.py@@ -6,6 +6,7 @@ import sysimport reimport tracebackimport importlib.util+import typesfrom .config import file_writer_configfrom .scene.scene import Scene@@ -123,7 +124,9 @@ def get_scene_classes_from_module(module):def get_module(file_name):if file_name == "-":module = types.ModuleType("input_scenes")+ logger.info("Enter the code for your animation and end with an EOF (usually CTRL+D):")code = sys.stdin.read()+ logger.info("Rendering animation from typed code...")try:exec(code, module.__dict__)return module