prompt-toolkit / pypager

A $PAGER in pure Python, similar to "less".
BSD 3-Clause "New" or "Revised" License
86 stars 19 forks source link

paging a string #14

Open kj7rrv opened 4 years ago

kj7rrv commented 4 years ago

I have a big multiline string. Can I page it without a generator?

jonathanslenders commented 4 years ago

Yes, there is a StringSource: https://github.com/prompt-toolkit/pypager/blob/master/pypager/source.py#L380

Use this instead of GeneratorSource, which is used in the example from the README: https://github.com/prompt-toolkit/pypager

kj7rrv commented 4 years ago

Thanks!