HomeDocs
DocsCommunityTestimonialsUsersGitHubTwitterBlogJobsTermsPrivacyCookies
TermsPrivacyCookies

run

Run a python_binary target.

To run an executable/script, simply use <<pantscmd>> run on a python_binary target, like this:

$ <<pantscmd>> run project/app.py

or

$ <<pantscmd>> run project:app

You may only run one target at a time.

📘

Tip: check the return code

Pants will propagate the return code from the underlying executable. Run echo $? after the Pants run to see the return code.

Passing arguments

To pass arguments to the script/executable, use -- at the end of the command, like this:

$ <<pantscmd>> run project/app.py -- --arg1 arg2 arg3

Note the single quotes. This is so that your shell does not escape the arguments.