Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
returncode
#1
"""
Create a function called returncode, taking a single integer argument that
would:
  1. Cause the program to exit, setting the return code to the value passed
    as an argument
  2. When inspected, would return the following help string:
    Exits the program with the specified returncode

For example:
  returncode(10) ->
  # Process terminates with return code of 10
"""

import sys
def returncode(b):
    """ Exits the program with the specified returncode"""
    sys.exit(b)
    """sys.exit('# Process terminates with return code of %s'%(b))"""
b = 10
returncode(b)
What is wrong in this...Is there a better way of doing this
Reply
#2
(Dec-09-2016, 01:40 AM)roadrage Wrote: What is wrong in this
Why do you believe something is wrong?
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020