Skip to content

str index out of range for wrap_text_to_lines #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
makermelissa opened this issue Dec 16, 2020 · 2 comments · Fixed by #105
Closed

str index out of range for wrap_text_to_lines #104

makermelissa opened this issue Dec 16, 2020 · 2 comments · Fixed by #105

Comments

@makermelissa
Copy link
Collaborator

I'm getting IndexError: str index out of range on wrapping strings with:

from adafruit_display_text import wrap_text_to_lines
print(wrap_text_to_lines("Hello World!", 5))
@makermelissa
Copy link
Collaborator Author

Also, this chops it up weird.

print(wrap_text_to_lines("Hello4 World!", 5))

results in

Hell-
Worl-
d!

@makermelissa
Copy link
Collaborator Author

For "Hello World", here's the pieces it is chopped into:

['', 'Worl-', 'd!']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant