pydu/docs/console.md

23 lines
537 B
Markdown
Raw Permalink Normal View History

2018-05-10 16:41:13 +00:00
# Console
2017-11-12 03:36:50 +00:00
2018-03-10 05:12:01 +00:00
Utils for handling console.
2018-05-10 16:41:13 +00:00
## console.console_size
```python
console_size(fallback=(80, 25))
```
2017-11-12 03:36:50 +00:00
2018-05-10 16:41:13 +00:00
For Windows, return (width, height) of available window area, fallback
if no console is allocated.
For POSIX system, return (width, height) of console terminal, fallback
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
2018-05-10 16:41:13 +00:00
```python
>>> from pydu.console import console_size
>>> console_size()
(80, 25)
```