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-alpha0
  • 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 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.0a0.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

lib_not_dr-0.2.0a0-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lib-not-dr-0.2.0a0.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.10.0 CPython/3.8.18+

File hashes

Hashes for lib-not-dr-0.2.0a0.tar.gz
Algorithm Hash digest
SHA256 a80dc305dfb977943abd0f98ccb6c4caeaab2026fba86cc4b172b3d1de17baf6
MD5 6ff3dd475ea1afedc31649bf8a0c2ab3
BLAKE2b-256 36c0b58673fef4801ec1539793ab0b2c60e45d6a9cd1ea44021e68b59b0d4e77

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for lib_not_dr-0.2.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1d4bb92674b30be6726ce562b3dd88a62a02268d121553ffad5b954b99566c6
MD5 64ca1f2c1efb125d31039e8dc55a8b0f
BLAKE2b-256 028237e240ccf475eb3eb379bb2cf32ded67247a464ffadbb36538d8ed27ebab

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