Popular recipes tagged "pagination"http://code.activestate.com/recipes/tags/pagination/2017-05-01T20:34:49-07:00ActiveState Code RecipesA simple text file pager in Python (Python)
2017-02-10T21:34:45-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580755-a-simple-text-file-pager-in-python/
<p style="color: grey">
Python
recipe 580755
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/commandline/">commandline</a>, <a href="/recipes/tags/pagination/">pagination</a>, <a href="/recipes/tags/paging/">paging</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/text/">text</a>, <a href="/recipes/tags/utilities/">utilities</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>This recipe shows how to create a simple text file pager in Python. It allows you to view text content a page at a time (with a user-definable number of lines per page). Like standard Unix utilities, it can either take a text file name as a command-line argument, or can read the text from its standard input, which can be redirected to come from a file, or to come from a pipe. The recipe is for Windows only, though, since it uses the msvcrt.getch() function, which is Windows-specific. However, the recipe can be modified to work on Unix by using things like tty, curses, termios, cbreak, etc.</p>
<p>More details here:</p>
<p><a href="https://jugad2.blogspot.in/2017/02/tp-simple-text-pager-in-python.html" rel="nofollow">https://jugad2.blogspot.in/2017/02/tp-simple-text-pager-in-python.html</a></p>
Pagination widget in Tkinter (Python)
2017-05-01T20:34:49-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580720-pagination-widget-in-tkinter/
<p style="color: grey">
Python
recipe 580720
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/megawidget/">megawidget</a>, <a href="/recipes/tags/pagination/">pagination</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 24.
</p>
<p>I added here a pagination widget in tkinter with different styles.</p>
<p>When this option <em>"hide_controls_at_edge"</em> is true, the widget hides <em>"next"</em>, <em>"previous"</em>, <em>"last"</em> and <em>"first"</em> buttons when they are not necessary. For example when pagination is at the first page then the buttons <em>"previous"</em> and <em>"first"</em> are not strictly necessary. Analogously when pagination is at the last page, the buttons <em>"last"</em> and <em>"next"</em> are not necessary because its not possible to go more forward.</p>
<p>The user can customize the text of <em>"next"</em>, <em>"previous"</em>, <em>"last"</em> and <em>"first"</em> buttons. When some of these options is None, then the corresponding button is not showed: <em>prev_button</em>. <em>next_button</em>, <em>first_button</em>, <em>last_button</em></p>
<p>The <em>"command"</em> option is a callback called every time a page is selected.</p>