My PyQt GUI book Create Simple GUI Applications has been updated, with new chapters on Qt Designer and multithreading. Get it here.

Dictionary Views & Set Operations

The keys, values and items from a dictionary can be accessed using the .keys(), .values() and .items() methods. These methods return view objects which provide a view on the source dictionary.

Dictionaries

Dictionaries are key-value stores, meaning they store, and allow retrieval of data (or values) through a unique key. This is analogous with a real dictionary where you look up definitions (data) using a given key — the word. Unlike a language dictionary however, keys in Python dictionaries are not alphabetically sorted.