IndexError: list index out of range in text_mobject
See original GitHub issueWindows 10, Python 3.8.5, latest Manim from master branch
from manimlib.imports import *
class test(Scene):
def construct(self):
t = r"""a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9 0 . : , ; ' " ( ! ? ) + - * / = ` ~ @ $ % ^ & [ ] { } _ \ | < >"""
text = Text(t, font='Arial', stroke_width=0)
self.add(text)
self.wait(.1)
Traceback (most recent call last):
File "C:\manim\manimlib\extract_scene.py", line 155, in main
scene = SceneClass(**scene_kwargs)
File "C:\manim\manimlib\scene\scene.py", line 75, in __init__
self.construct()
File "C:\test.py", line 8, in construct
text = Text(t, font='Arial', stroke_width=0)
File "C:\manim\manimlib\mobject\svg\text_mobject.py", line 67, in __init__
self.apply_space_chars()
File "C:\manim\manimlib\mobject\svg\text_mobject.py", line 162, in apply_space_chars
space.move_to(self.submobjects[char_index - 1].get_center())
IndexError: list index out of range
Whereas these lines work fine:
text = Text(t[2:], font='Arial', stroke_width=0)
text = Text(t[:-2], font='Arial', stroke_width=0)
It looks like SVGMobject
cannot handle symbols like <
and >
. Any Ideas how to fix that?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
IndexError: list index out of range in text_mobject · Issue #1234
Windows 10, Python 3.8.5, latest Manim from master branch from manimlib.imports import * class test(Scene): def construct(self): t ...
Read more >I keep getting “IndexError: list index out of range” when trying ...
This error basically means you are trying to access a value at a List index which is out of bounds i.e greater than...
Read more >Index error: list index out of range - How to skip a broken URL?
Every time I run this, it will stop whenever it encounters a URL that doesn't exist and gives the error: index error: list...
Read more >Indexerror: list Index Out of Range in Python - STechies
In python “list index out of range” error occurs when we try to access an undefined element from the list. List index out...
Read more >Python IndexError: List Index Out of Range [Easy Fix] - Finxter
To solve the “IndexError: list index out of range”, avoid do not access a non-existing list index. For example, my_list[5] causes an error...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@naveen521kk Thanks for your work!
No, we don’t have something similar for now.
I think I have identified the issue and it should be solved via #476.