manim icon indicating copy to clipboard operation
manim copied to clipboard

Code Class not work

Open 0x20e opened this issue 6 months ago • 1 comments

Describe the bug

the Code Class not work. just raise Exception.

class DemoScene(Scene):

def construct(self):
    
    c = Code('sorted(iterable, key=None, reverse=False)')
    self.play(FadeIn(c))
    
    self.wait()

Wrong display or Error traceback:

Additional context

0x20e avatar Jun 09 '25 03:06 0x20e

you can use

solve #2355

from manimlib import *

class CodeClassWorking(Scene):
    def construct(self):
        # Insted
        c = Code(
            """
            from manimlib import *

            class Test(InteractiveScene):
                def construct(self):
                    pass

            """
        )
        self.play(
            Write(c)
        )

Output

https://github.com/user-attachments/assets/7cecd88c-7beb-4581-b30c-6c669238fff0


mathsvisualization avatar Jul 19 '25 07:07 mathsvisualization