Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
| The project help you to quickly build layouts in terminal | (这个一个命令行ui布局工具)
.. image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/demo_v2_1.gif
.. image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/demo.gif :width: 450
Some extensions base on terminal_layout
progress <terminal_layout/extensions/progress/README.md>
__|progress.gif|
choice <terminal_layout/extensions/choice/README.md>
__|choice.gif|
** video demo **
.. image:: https://asciinema.org/a/226120.svg :width: 550 :target: https://asciinema.org/a/226120
All Demo <https://github.com/gojuukaze/terminal_layout/tree/master/demo>
__Github <https://github.com/gojuukaze/terminal_layout>
__Docs <https://terminal-layout.readthedocs.io>
__https://asciinema.org/a/226120 <https://asciinema.org/a/226120>
__.. code:: bash
pip install terminal-layout
====== =============== Python terminal_layout ====== =============== 2.7 2.1.x 3.5+ 3.x ====== ===============
.. code:: python
import time from terminal_layout import *
ctl = LayoutCtl.quick(TableLayout, # table id: root [ [TextView('t1', 'Hello World!', width=Width.fill, back=Back.blue)], # <- row id: root_row_0, [TextView('t2', '', fore=Fore.magenta)], # <- row id: root_row_1, ], )
layout = ctl.find_view_by_id('root') layout.set_width(20)
ctl.draw()
ctl.find_view_by_id('t2').delay_set_text('你好,世界!', delay=0.2)
time.sleep(0.5) row3 = TableRow.quick_init('', [TextView('t3', 'こんにちは、世界!')]) layout.add_view(row3)
ctl.stop()
|image2|
.. code:: python
import time from terminal_layout import *
ctl = LayoutCtl.quick(TableLayout, # table id: root [ [TextView('t1', 'Hello World!', width=Width.fill, back=Back.blue)], # <- row id: root_row_1, [TextView('t2', '', fore=Fore.magenta)], # <- row id: root_row_2, ], )
layout = ctl.find_view_by_id('root') layout.set_width(20)
ctl.draw(auto_re_draw=False)
ctl.find_view_by_id('t2').set_text('你好,世界!') ctl.re_draw()
time.sleep(0.5) row3 = TableRow.quick_init('', [TextView('t3', 'こんにちは、世界!')]) layout.add_view(row3) ctl.re_draw()
.. code:: python
from terminal_layout import * import sys reload(sys) sys.setdefaultencoding('utf-8')
ctl = LayoutCtl.quick(TableLayout, [ [TextView('', u'中文,你好', back=Back.cyan, width=Width.wrap)], [TextView('', u'中文,你好', back=Back.cyan, width=6)], [TextView('', u'日本語,こんにちは', back=Back.cyan, width=Width.wrap)], ]
)
ctl.draw()
|image3|
.. code:: python
TextView('','fore',fore=Fore.red) TextView('','back',back=Back.red)
.. image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/color.jpeg :width: 560
.. code:: python
TextView('','style',style=Style.dim)
.. image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/style.jpeg :width: 560
.. code:: python
TextView('','width',width=10)
.. image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/width.jpeg :width: 560
.. code:: python
TextView('','weight',weight=1)
.. image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/weight.jpeg :width: 560
.. code:: python
TextView('','gravity',gravity=Gravity.left)
.. image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/gravity.jpeg :width: 560
.. code:: python
TextView('','',visibility=Visibility.visible)
.. image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/visibility.jpeg :width: 560
.. code:: python
TextView('','ex_style',style=Style.ex_blink)
.. image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/ex_style.jpeg :width: 560
.. code:: python
TextView('','ex_fore',fore=Fore.ex_red_1) TextView('','ex_back',back=Back.ex_red_1)
.. image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/ex_color.jpeg :width: 560
GPLv3 <https://github.com/gojuukaze/terminal_layout/blob/master/LICENSE>
__
colorama <https://github.com/tartley/colorama>
__ : Simple
cross-platform colored terminal text in Pythoncolored <https://gitlab.com/dslackw/colored>
__ : Very simple Python
library for color and formatting in terminal.. |progress.gif| image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/progress.gif .. |choice.gif| image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/choice.gif .. |image2| image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/hello.png .. |image3| image:: https://github.com/gojuukaze/terminal_layout/raw/master/pic/py2.png
FAQs
The project help you to quickly build layouts in terminal (命令行ui布局工具)
We found that terminal-layout demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.