Skip to main content

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

shenjackyuanjie

更新日志|Change Log

License/许可证

MPL-2.0

安装/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.0b2.tar.gz (38.0 kB view details)

Uploaded Source

Built Distribution

lib_not_dr-0.2.0b2-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file lib-not-dr-0.2.0b2.tar.gz.

File metadata

  • Download URL: lib-not-dr-0.2.0b2.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

Hashes for lib-not-dr-0.2.0b2.tar.gz
Algorithm Hash digest
SHA256 ba450289b8951761409ee714f8aa4bf332e39b52f1559a8562e40278d1abeb84
MD5 90affc8b6db9513303c001b1356dcbd0
BLAKE2b-256 01ddf7d75ba2256b49efbc36d80eaa289bbafb0db52facaf2ee7325a7a1de12a

See more details on using hashes here.

File details

Details for the file lib_not_dr-0.2.0b2-py3-none-any.whl.

File metadata

  • Download URL: lib_not_dr-0.2.0b2-py3-none-any.whl
  • Upload date:
  • Size: 41.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.10.3 CPython/3.8.18+

File hashes

Hashes for lib_not_dr-0.2.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 bb8554b58fdb8e665eef6235f7d56c7927efc8015fe62e38f41fe8c8861822f0
MD5 ae6b0bed7cf0de9fa8bfa65900e876e7
BLAKE2b-256 d39c3d38b14e82d0af3dd1c0421af76d38f8eafde7e11ccee6a700ac50728bc4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page