A python lib created from Difficult Rocket development
Project description
lib-not-dr
A python lib came from Difficult Rocket development
一个在 Difficult Rocket 开发中 分离出来的 python 库
Information/信息
- Version / 版本: 0.2.0-beta.0
- Author / 作者: shenjackyuanjie 3695888@qq.com
License/许可证
安装/Install
pip install lib-not-dr
使用/Usage
Logger
WIP 等待 0.2.0
from lib_not_dr.logger.logger import Logger
logger = Logger.get_logger_by_name("test")
logger.fine('Hello World!')
logger.debug('Hello World!')
logger.trace('Hello tracing!')
logger.info('Hello World!') # info!
logger.warn('warnnnnnnn')
logger.error('Hello World!')
logger.fatal('good bye world')
# tag
logger.info('this message if from tag', tag='test')
logger.debug('this debug log if from admin', tag='admin')
# end
logger.debug('and this message ends with none', end=' ')
logger.trace('so this message will be in the same line', tag='same line!')
Nuitka pyproject paser
WIP 等待 0.2.0
[tool.lndl.nuitka]
main = "main.py"
# --main=main.py
Nuitka Compiler Helper
simple example 简单示例
import subprocess
from pathlib import Path
from lib_not_dr.nuitka.compile import CompilerHelper
compiler = CompilerHelper(src_file = Path("main.py"))
print(compiler)
subprocess.run(compiler.gen_subprocess_cmd())
more complex example 复杂示例
import sys
import subprocess
from pathlib import Path
from lib_not_dr.nuitka.compile import CompilerHelper
compiler = CompilerHelper(src_file = Path("main.py"), run_after_build=True)
print(compiler)
if '-y' in sys.argv or '--yes' in sys.argv:
do_run = True
elif '-n' in sys.argv or '--no' in sys.argv:
do_run = False
else: # do_run is None
while (do_run := input("compile? [y/n]").lower()) not in ["y", "n", "yes", "no"]:
pass
# 获取用户输入是否编译
# get user confirmation to compile or not
do_run = True if do_run[0] == "y" else False
if do_run:
subprocess.run(compiler.gen_subprocess_cmd())
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
lib-not-dr-0.2.0b1.tar.gz
(38.0 kB
view details)
Built Distribution
File details
Details for the file lib-not-dr-0.2.0b1.tar.gz
.
File metadata
- Download URL: lib-not-dr-0.2.0b1.tar.gz
- Upload date:
- Size: 38.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.10.3 CPython/3.8.18+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fe83b5a8d36bf2276e19cc6f60e9f7221904ae9079336a088713087613c9e3a |
|
MD5 | b7dd7700e9412a31fb28a1b3306b3f2d |
|
BLAKE2b-256 | 73da860ee0014119bbb94b79f968f7a876290c36796b83ed101e1da51819db20 |
File details
Details for the file lib_not_dr-0.2.0b1-py3-none-any.whl
.
File metadata
- Download URL: lib_not_dr-0.2.0b1-py3-none-any.whl
- Upload date:
- Size: 41.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.10.3 CPython/3.8.18+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 296fc71f2bf0220b7036cebfe099d82d8d56d23d3aa08476cb2c2a033df71a4d |
|
MD5 | 292067292d3d3aced951b8673749cd82 |
|
BLAKE2b-256 | a2db58f66c79f31cab1c841a0b5caad7cceb48e56bcb5774d6a3f142678766cd |