MCPcopy Index your code
hub / github.com/kivy/python-for-android / get_console_width

Function get_console_width

pythonforandroid/logger.py:112–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110
111
112def get_console_width():
113 try:
114 cols = int(os.environ['COLUMNS'])
115 except (KeyError, ValueError):
116 pass
117 else:
118 if cols >= 25:
119 return cols
120
121 try:
122 cols = max(25, int(os.popen('stty size', 'r').read().split()[1]))
123 except Exception:
124 pass
125 else:
126 return cols
127
128 return 100
129
130
131def shprint(command, *args, **kwargs):

Callers 1

shprintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected