Python: add runnable task to run file as module #26460
griendt
started this conversation in
Feature Ideas / Enhancements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Python files can already be run as-is, but some scripts are (sub)modules of a package and should be run as a module (
python some/script.py
versuspython -m some.script
). This is particularly useful for scripts that live in subdirectories of a package, or use relative imports, etc.Ideal would be to have a runnable task in the gutter upon seeing a conventional "main" function:
Example:

Beta Was this translation helpful? Give feedback.
All reactions