inducer / pudb

Full-screen console debugger for Python
https://documen.tician.de/pudb/
Other
2.99k stars 230 forks source link

Is it possible to debug a python command line tools? #492

Closed BrightXiaoHan closed 2 years ago

BrightXiaoHan commented 2 years ago

This is setup.py file for my library

from setuptools import setup

setup(
    name="lib_translate",
    version="1.0",
    author="hanbing",
    author_email="beatmight@gmail.com",
    description="Translate SDK for Lan-MT",
    # 项目主页
    url="http://fanyi.dtranx.com",
    # 你要安装的包,通过 setuptools.find_packages 找到当前目录下有哪些包
    packages=["libtranslate", "libtranslate.translate",
              "libtranslate.third_party", "libtranslate.bin"],
    install_requires=[item.strip()
                      for item in open("requirements.txt", "r").readlines()],
    entry_points={
        "console_scripts": [
            "libtrans_interact=libtranslate.bin.interact:main",
            "libtrans_genbt=libtranslate.bin.genbt:main",
            "libtrans_translate=libtranslate.bin.translate:main",
            "libtrans_relase=lib_translate.bin.release:main"
        ],
    }
)

libtrans_interactlibtrans_genbtand ... is the cli tools installed with my library.

How can I debug the cli command use pudb like this

pudb3 libtrans_genbt