[issue39774] Missing documentation on how to make package executable as script
New submission from igo95862 <igo9586@gmail.com>: This is package documentation: https://docs.python.org/3/tutorial/modules.html#packages To make package executable (python -m package) you need to create a file __main__.py in the package directory. This is pretty much not documented anyone aside of trying to run a package missing __main__.py This page already contains information on how to make module executable. (https://docs.python.org/3/tutorial/modules.html#executing-modules-as-scripts) ---------- assignee: docs@python components: Documentation messages: 362790 nosy: docs@python, igo95862 priority: normal severity: normal status: open title: Missing documentation on how to make package executable as script type: enhancement versions: Python 3.8 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39774> _______________________________________
Steven D'Aprano <steve+python@pearwood.info> added the comment: You're right that it's hard to find any documentation on package `__main__.py` files. There's nothing here that I can see: https://docs.python.org/3/reference/import.html#packages Aside from the tutorial, the only other place I can find it referenced is a really brief aside here: https://docs.python.org/3/library/__main__.html ---------- nosy: +steven.daprano _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39774> _______________________________________
Change by Andrei Daraschenka <dorosch.github.io@yandex.ru>: ---------- keywords: +patch nosy: +dorosch nosy_count: 3.0 -> 4.0 pull_requests: +18037 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18677 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39774> _______________________________________
Change by igo95862 <igo9586@gmail.com>: ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39774> _______________________________________
participants (3)
-
Andrei Daraschenka
-
igo95862
-
Steven D'Aprano