Python Language sys

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

The sys module provides access to functions and values concerning the program's runtime environment, such as the command line parameters in sys.argv or the function sys.exit() to end the current process from any point in the program flow.

While cleanly separated into a module, it's actually built-in and as such will always be available under normal circumstances.

Syntax

  • Import the sys module and make it available in the current namespace:

    import sys
    
  • Import a specific function from the sys module directly into the current namespace:

    from sys import exit
    

Remarks

For details on all sys module members, refer to the official documentation.



Got any Python Language Question?