Skip to content

armgit / manim

Public Imported from GitHub
0

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__.py
index 63f7bebba..0bd7225e5 100644
--- a/manim/__main__.py
+++ b/manim/__main__.py
@@ -6,6 +6,7 @@ import sys
import re
import traceback
import importlib.util
+import types
from .config import file_writer_config
from .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