pydu/docs/console.rst

19 lines
561 B
ReStructuredText
Raw Normal View History

2017-11-12 03:36:50 +00:00
Console
-------
2018-03-10 05:12:01 +00:00
Utils for handling console.
.. py:function:: pydu.console.console_size(fallback=(80, 25))
2017-11-12 03:36:50 +00:00
For Windows, return (width, height) of available window area, fallback
2017-11-12 03:36:50 +00:00
if no console is allocated.
For POSIX system, return (width, height) of console terminal, fallback
2017-11-12 03:36:50 +00:00
on IOError, i.e. when no console is allocated.
For other system, return fallback.
Fallback defaults to (80, 25) which is the default size used by many
terminal emulators.
2017-11-12 03:36:50 +00:00
>>> from pydu.console import console_size
>>> console_size()
(80, 25)