Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7410045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:10:20+00:00 2026-05-29T06:10:20+00:00

I have a utility that is written in Python and is meant to be

  • 0

I have a utility that is written in Python and is meant to be used on its own or in conjunction with other shell utilities. As such, my utility exits with status codes (e.g. 0 if everything is fine, 1 when an input file or output directory doesn’t exist, etc.).

My question: I’m using argparse module and it works great, not only for parsing options but for generating help. However, I’d like to be able to add some info about my exit statuses to the help as well. Is this possible with argparse; am I missing something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:10:21+00:00Added an answer on May 29, 2026 at 6:10 am

    That’s an info I’d put inside the epilog.

    Adjusting the example from the official documentation:

    >>> import argparse
    >>> parser = argparse.ArgumentParser(
    ...     description='This is my utility description.',
    ...     epilog='The exit status will be 0 if everything is fine, '
    ...            'and 1 if an input-file or an output-directory does not exist')
    >>> 
    >>> parser.print_help()
    usage: [-h]
    
    This is my utility description.
    
    optional arguments:
      -h, --help  show this help message and exit
    
    The exit status will be 0 if everything is fine, and 1 when an input-file or
    an output-directory does not exist
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a utility that I have written in VB.net that runs as a
I have a number of utilities that were written in the days of yore
I have a simple single threaded utility written in C# that inserts data into
I have just written a small utility to be used in a pre-build event.
I have a small utility that was originally written in VS2005. I need to
I have four small single-form utility applications that I have written in Delphi (Win32),
I have written a C utility for Linux that checks the contents of /proc/net/dev
I have written a utility that requires an installation key for uninstallation to ensure
I have written a utility that monitors for Unhandled Exceptions and then creates a
I have written a simple utility that loops through all C# files in my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.