Miscellaneous options

More than a dozen miscellaneous options are available for the python command. While most options are available in both Python 2 and Python 3, there may be some differences between versions. It is best to double-check https://docs.python.org/2.7/using/cmdline.html if questions arise (make sure to switch to the version you're using).

Each option is explained here:

  • -b, -bb: Provide a warning when comparing bytes/bytesarray with str or bytes with int. A double b will provide an error rather than a warning.
  • -B: Do not write .pyc bytecode files when importing source modules. Related to PYTHONDONTWRITEBYTECODE.
  • -d: Turn on parser debugging output. Related to PYTHONDEBUG.
  • -E: Ignore all PYTHON* environment variables, such as  ...

Get Secret Recipes of the Python Ninja now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.