0 and 1 are the exit codes.
exit(0)
means a clean exit without any errors / problems
exit(1)
means there was some issue / error / problem and that is why the program is exiting.
This is not Python specific and is pretty common. A non-zero exit code is treated as an abnormal exit, and at times, the error code indicates what the problem was. A zero error code means a successful exit.
This is useful for other programs, shell, caller etc. to know what happened with your program and proceed accordingly.
Related Posts:
- Exit codes in Python
- How do I copy a file in Python?
- Use Gif Logo For Loading Screen In Kivy
- How can I make a time delay in Python? [duplicate]
- Python – TypeError: ‘int’ object is not iterable
- are there dictionaries in javascript like python?
- How do I update\upgrade pip itself from inside my virtual environment?
- What does the “yield” keyword do?
- Renaming column names in Pandas
- Does Python have a string ‘contains’ substring method?
- Is there a “not equal” operator in Python?
- IndexError: list index out of range and python
- beyond top level package error in relative import
- How do you append to a file?
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- Jupyter Notebook not saving: ‘_xsrf’ argument missing from post
- What does it mean to have an index to scalar variable error? python
- Could not install packages due to an EnvironmentError:
- What does “e” in “1e-5” in Python language mean and what is the name of this notation?
- How to avoid “RuntimeError: dictionary changed size during iteration” error?
- ‘Conda’ is not recognized as internal or external command
- `from … import` vs `import .` [duplicate]
- How to read a text file into a string variable and strip newlines?
- ln (Natural Log) in Python
- How do I select rows from a DataFrame based on column values?
- How to round to 2 decimals with Python?
- How do I concatenate two lists in Python?
- Convert DataFrame column type from string to datetime, dd/mm/yyyy format
- How can I remove a trailing newline?
- Is there a list of line styles in matplotlib?
- Import urllib.request, ImportError: No module named request
- TypeError: cannot convert the series to
- Get a list from Pandas DataFrame column headers
- ‘End of statement expected’ in pycharm
- How to import files in python using sys.path.append?
- Tensorflow: why ‘pip uninstall tensorflow’ cannot find tensorflow
- TypeError: object of type ‘int’ has no len() – Python/Pygame
- How to create new folder?
- Python Sets vs Lists
- How do I resize an image using PIL and maintain its aspect ratio?
- Display image as grayscale using matplotlib
- AttributeError: ‘list’ object has no attribute ‘replace’ when trying to remove character
- PermissionError: [WinError 5] Access is denied
- Pytorch reshape tensor dimension
- How to iterate over columns of pandas dataframe to run regression
- JSON to pandas DataFrame
- Convert decimal to binary in python
- How to remove specific elements in a numpy array
- Converting between datetime and Pandas Timestamp objects
- Overflow / math range error for log or exp
- Python, print all floats to 2 decimal places in output
- RuntimeWarning: divide by zero encountered in log
- clang error: unknown argument: ‘-mno-fused-madd’ (python package installation failure)
- Deleting DataFrame row in Pandas based on column value
- Timeout on a function call
- Pandas long to wide reshape, by two variables
- how to create a list of lists
- Python – ‘ascii’ codec can’t decode byte
- Python assigning multiple variables to same value? list behavior
- IDLE’s subprocess didn’t make a connection. Either IDLE can’t start or personal firewall software is blocking the connection
- How to update a plot in matplotlib?
- ImportError: No module named MySQLdb
- Comparing two dictionaries and checking how many (key, value) pairs are equal
- Does Numpy automatically detect and use GPU?
- Properly formatted multiplication table
- How can I check whether a numpy array is empty or not?
- What is a ‘NoneType’ object?
- Class constants in python
- How do I print the key-value pairs of a dictionary in python
- urllib2 HTTP Error 400: Bad Request
- Plot correlation matrix using pandas
- How to fix “AttributeError: module ‘tensorflow’ has no attribute ‘get_default_graph'”?
- Iterating over a 2 dimensional python list [duplicate]
- How do I get the full path of the current file’s directory?
- How to remove project in PyCharm?
- Parse date string and change format
- Appending to a list gives ‘int’ object has no attribute ‘append’
- How to fix error “ERROR: Command errored out with exit status 1: python.” when trying to install django-heroku using pip
- urllib and “SSL: CERTIFICATE_VERIFY_FAILED” Error
- Matplotlib plots: removing axis, legends and white spaces
- How do I disable a Pylint warning?
- UDP Client/Server Socket in Python
- How to handle a Button click event
- Numpy Resize/Rescale Image
- numpy array concatenation error: 0-d arrays can’t be concatenated
- Purpose of #!/usr/bin/python3 shebang
- The view didn’t return an HttpResponse object. It returned None instead
- Python TypeError: ‘set’ object is not subscriptable
- Python and PYAML – yaml.scanner.ScannerError: mapping values are not allowed here
- ValueError: The channel sent is invalid on a Raspberry Pi – Controlling GPIO Pin 2 (BOARD) using Python causes Error
- How can I extract all values from a dictionary in Python?
- Python ‘while’ with two conditions: “and” or “or”
- How to pass a list by reference?
- Python Quicksort Runtime Error: Maximum Recursion Depth Exceeded in cmp
- “for loop” with two variables?
- Python webbrowser.open() to open Chrome browser
- Flatten nested dictionaries, compressing keys
- Python 2.7 mixing iteration and read methods would lose data
- Conditional indexing with Numpy ndarray
- python numpy machine epsilon