Get entry point script file location in setuputils package?

后端 未结 3 1980
你的背包
你的背包 2021-02-19 23:04

So I have an entry point defined in my setup.py [console_scripts] section. The command is properly installed and works fine, but I need a way to programatically find out the pat

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-19 23:43

    Have you tried `os.path.abspath(__file__)' in your entry point script? It'll return yours entry point absolute path.

    Or call find_executable from distutils.spawn:

    import distutils.spawn distutils.spawn.find_executable('executable')

提交回复
热议问题