Skip to content
This repository was archived by the owner on Sep 1, 2021. It is now read-only.
This repository was archived by the owner on Sep 1, 2021. It is now read-only.

pretty printing long Collections #4

@akvadrako

Description

@akvadrako

It would be nice if collections included a way to print them that truncated long sequences. For now, I'm using this:

def trunc(text):
ret = []
for l in str(text).splitlines():
if len(l) > 100:
l = l[:40] + ' ... ' + l[-40:]
ret.append(l)

return "\n".join(ret)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions