PyOSCmd
PyOSCmd是一个用于开发终端命令行的第三方库,简单,易用。
- Color.py
STD_INPUT_HANDLE = -10
STD_OUTPUT_HANDLE= -11
STD_ERROR_HANDLE = -12
FOREGROUND_BLACK = 0x00 # black.
FOREGROUND_DARKBLUE = 0x01 # dark blue. 暗蓝色
FOREGROUND_DARKGREEN = 0x02 # dark green. 暗绿色
FOREGROUND_DARKSKYBLUE = 0x03 # dark skyblue. 暗天蓝色
FOREGROUND_DARKRED = 0x04 # dark red. 暗红色
FOREGROUND_DARKPINK = 0x05 # dark pink. 暗粉红色
FOREGROUND_DARKYELLOW = 0x06 # dark yellow. 暗黄色
FOREGROUND_DARKWHITE = 0x07 # dark white. 暗白色
FOREGROUND_DARKGRAY = 0x08 # dark gray. 暗灰色
FOREGROUND_BLUE = 0x09 # blue.
FOREGROUND_GREEN = 0x0a # green.
FOREGROUND_SKYBLUE = 0x0b # skyblue.
FOREGROUND_RED = 0x0c # red.
FOREGROUND_PINK = 0x0d # pink.
FOREGROUND_YELLOW = 0x0e # yellow.
FOREGROUND_WHITE = 0x0f # white.
BACKGROUND_BLUE = 0x10 # dark blue.
BACKGROUND_GREEN = 0x20 # dark green.
BACKGROUND_DARKSKYBLUE = 0x30 # dark skyblue.
BACKGROUND_DARKRED = 0x40 # dark red.
BACKGROUND_DARKPINK = 0x50 # dark pink.
BACKGROUND_DARKYELLOW = 0x60 # dark yellow.
BACKGROUND_DARKWHITE = 0x70 # dark white.
BACKGROUND_DARKGRAY = 0x80 # dark gray.
BACKGROUND_BLUE = 0x90 # blue.
BACKGROUND_GREEN = 0xa0 # green.
BACKGROUND_SKYBLUE = 0xb0 # skyblue.
BACKGROUND_RED = 0xc0 # red.
BACKGROUND_PINK = 0xd0 # pink.
BACKGROUND_YELLOW = 0xe0 # yellow.
BACKGROUND_WHITE = 0xf0 # white.
| 显示方式 | 效果 | 前景色 | 背景色 | 颜色描述 |
|---|---|---|---|---|
| 0 | 终端默认设置 | 30 | 40 | 黑色 |
| 1 | 高亮显示 | 31 | 41 | 红色 |
| 4 | 使用下划线 | 34 | 42 | 绿色 |
| 5 | 闪烁 | 33 | 43 | 黄色 |
| 7 | 反白显示 | 34 | 44 | 蓝色 |
| 8 | 不可见 | 35 | 45 | 紫红色 |
| 22 | 非高亮显示 | 36 | 46 | 青蓝色 |
| 24 | 去下划线 | 37 | 47 | 白色 |
| 25 | 去闪烁 | |||
| 27 | 非反白显示 | |||
| 28 | 可见 |
import PyOSCmd
# OutWindowsFontColor
PyOSCmd.OutWindowFontColor().Print(data="Hello PySysCmd", color=PyOSCmd.LINUX_BOLD)
# Out Hello PySysCmd
# OurLinuxFontColor
PyOSCmd.OutLinuxFontColor().Print(data="Hello Linux!", config=[1, 31, 47])
PyOSCmd.OutLinuxFontColor().Print(data="Hello Linux!", config=PyOSCmd.LINUX_WARNING)
# Out Hello Linux!
- 使用事例
import PyOSCmd
import sys
def text():
print("Test!")
PyOSCmd.PyOSCmd(
{
"-h":"--help",
"-t":text
},
sys.argv[0:],
PyOSCmd.OutWindowFontColor,
PyOSCmd.FOREGROUND_YELLOW
)
QQ:2097632843 QQ群:706128290 mail:mc2005wj@163.com
Metadata
Release files for PyOSCmd 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| PyOSCmd-0.1.tar.gz | 4.8 kB | Without provenance | Details for PyOSCmd-0.1.tar.gz |
Release files / PyOSCmd-0.1.tar.gz
| Download URL | PyOSCmd-0.1.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
44e639f46eaf54969956986eb28e17a0db5eeda5a76238e82e9f05e0c52467fe
|
|
BLAKE2b-256 checksum How to use checksums |
5fd218ac6635f8e0cbcc8047a890cd5332f9d05f23d084a9b492b3e28d4c0f4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for PyOSCmd 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.