Skip to main content

Code_Tools

介绍:

一个给初学者制作的 Python 工具库, 基于 Python 3.14.4 制作

安装

pip install code_tools

可用内容

color()

参数包括text_color(选择颜色,使用ANSI序列码), mode(显示方式, 常用的是"1", 如果不需要显示方式, 使用默认方式可以输入"0"), IsEnter 默认是True, 也就是多换一行, 你可以更换设置为False让输出没有多余换行, 函数参数最后面可以增加end, sep等操作

clear_screen()

直接输入这个函数名就可以让代码检测你的系统并使用对应的清屏命令

例如:

"win32" = Windows

else = macOS, Linux

对应代码为:

from sys import platform, exit
from subprocess import run

if platform == "win32" # <- win32 == Windows
    run("cls", shell=True)
else: # <- 包括 macOS 和 Linux
    run("clear", shell=True)
safe_input()
safe_int()
safe_float()

除了 safe_input 以外都包括 ValueError 处理, 因为 input 不可能触发 ValueError

3个函数包括的参数有: prompt, text_color, mode

prompt 是用户输入提示

text_color 是用户提示的颜色, 就像 color 函数中的 text_color 一样

mode 也是 color 中的意思, 不过这次如果 color 和 mode 参数不写就会使用默认参数 ( 37 白色和 0 默认)

< 感谢您的阅读, 我是Luci_Code, 一名2014年出生的开发者 >

Metadata

Release files for luci-code-tools 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for luci-code-tools 0.1.2
File Size Uploaded Provenance Actions
luci_code_tools-0.1.2.tar.gz 2.8 kB Without provenance Details for luci_code_tools-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for luci-code-tools 0.1.2
File Interpreter ABI Platform Actions
luci_code_tools-0.1.2-py3-none-any.whl Python 3 none any Details for luci_code_tools-0.1.2-py3-none-any.whl

Total release size: 5.9 kB

Release files / luci_code_tools-0.1.2.tar.gz

Download URL luci_code_tools-0.1.2.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5d938cdd472ebc767cea7fd65a5a9774ff76eb6ccd343af437311d70f27b5648
BLAKE2b-256 checksum
How to use checksums
f7e0d356e7e131ebb1da11063a711aa943f46fe32ffae28a0a5f8841da7fc141
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / luci_code_tools-0.1.2-py3-none-any.whl

Download URL luci_code_tools-0.1.2-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1524c7b78706bd3e666baab8e72c6f9dfbdbfd22e804d7ca04143bd4f5d6c2dc
BLAKE2b-256 checksum
How to use checksums
cda780be1bc73f406284103613f1dc1e02dca13c249640a4bda6dea7ef0c0ed3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for luci-code-tools 0.1.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page