lightsmile's personal Python util libs
Project description
lightUtils
本项目仅为自己的Python常用工具类。
其中有些是自己写的,有的则是网上找的,由于有些还需要copy代码到相应需求处才能使用,比如说放在gist或其他代码片段保存工具并不太方便,所以这里也构建一个库,用的时候先install
然后直接import
就好了。
功能
- 彩色日志
- 获取系统可用tcp端口
使用
1.彩色日志
示例
from lightutils import logger
logger.info("info")
logger.warning('warning')
logger.debug('debug')
logger.error('error')
效果如图:
2.获取系统可用tcp端口
示例
from lightutils import get_free_tcp_port
port = get_free_tcp_port()
print(port)
执行结果为:
49783
<class 'int'>
参考
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lightUtils-0.1.2.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for lightUtils-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 651a34919de978b0672e7c20f222690128ddc6c50f72f5ad1a2a4bbb36114714 |
|
MD5 | 3e1ce0dc250af9b397666416e2bdfc9a |
|
BLAKE2b-256 | 8569c3f820af417e9d6df52e07756be5ca4b2a44fe3a45e3ee2b9173fda81f5c |