screen类允许您对dos终端进行定位写入。
dosbox-screen的Python项目详细描述
– Screen positioning and colors in the dos shell (and unix too)
安装
pip install doscmd-screen
更改
版本1.1.0引入了screen.color(“txt”,fg=”white',bg=”blue'),其中 返回一个稍后可以打印的字符串。
版本1.0.3通过window类引入线程安全的窗口区域。
版本1.0中的更改包括对非DOS平台的支持 测试脚本,以及基于零的屏幕位置索引。从上次开始 一个是向后不兼容的更改我已经升级了主要版本 号码。我不放弃任何向后不兼容的变化 这个模块。
用法
终端中的直接定位和终端颜色:
import screen # screen probably needs to be your first import. scr = Screen() scr.centerxy(scr.center, scr.middle, '((.))') scr.writexy(scr.left, scr.bottom, 'left bottom', color='black', on='red')
适用于两个窗口..
和类Unix终端: