Sitemap

Member-only story

Python Sys Module All Notes

4 min readMar 12, 2022

--

Press enter or click to view image in full size

In this article you’ll see almost all sys module usages in the Python programming language.

The sys module provides functions and variables used to manipulate different parts of the Python runtime environment and details about the Python interpreter.

This module provides a lot of information about the Python interpreter, such as the version of the interpreter, the maximum value that the variable can hold, the copyright information of the Python interpreter, etc.

The following functionalities from the sys module will be covered in this article:

  1. sys.argv
  2. sys.version
  3. sys.path
  4. sys.maxsize
  5. sys.stdout
  6. sys.copyright
  7. sys.platform
  8. sys.execute
  9. sys.exit
  10. sys.getsize()

sys.argv

The argv method returns the command line arguments in the form of a list that had been passed to the Python script/code. Here it is important to note that the first item in the list returned (indexed 0) refers to the name of the script. The other arguments are present in the subsequent index of the list.

--

--

HKN MZ
HKN MZ

Written by HKN MZ

I am writing about Sql Server, Elasticsearch and Python. İ am an Database Administrator on SQL Server and Elasticsearch more than 5+ years.