Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Examples using format with attributes of objects

This is also a rather strange example, I don't think I'd use it in real code.

import sys

print("{0.executable}".format(sys))
print("{system.argv[0]}".format(system = sys))
/home/gabor/venv3/bin/python
formatted_attributes.py