PP(MC)

  1. Top
  2. Part One - Fundamentals
  3. Part Two - The standard library
  4. Part Three - The craft by example
  5. Appendices
  6. Typographical conventions

Python programming

for musicians and composers

Part One - Fundamentals

  1. Getting started

    Setting up the working environment Installing Python 3.7 · Choosing a text editor · Virtual environments · Git

    On Being (Pythonic)

  2. Built-in data types

    Numeric types int · float · Arithmetic

    Variables

    Container types list · tuple · "of arbitrary objects" · str · set · dict · Arithmetic operators on container types

  3. Functions and methods

    Arguments Function descriptions · Required and optional arguments · Arbitrary number of arguments

    Built-in functions Interaction · String formatting · Characters · Type conversions (explicit casting) · frozenset · More arithmetic · Iterables · help

    Built-in container type methods list methods · dict methods

    Defining functions Comments and documentation · Scope · None · Positional and Keyword arguments · pass, return, and yield

    lambda functions

  4. Control flow

    Logic Truth · Relational operators · Boolean operators

    Presence and identity in · is

    Conditional if

    Iteration for, in · break · continue · Comprehensions · while

    Built-in functions map, filter · any, all

    Exceptions try, except, finally

    Recursion

  5. Objects
  6. Modules and packages

Part Two - The standard library

Part Three - The craft by example

Appendices

  1. Appendix : The surface of things

    A review of Python's syntax.

  2. Appendix : The music theory primer

    An introduction to the music theory requirements for this book.

Typographical conventions

Code that is written inline with the text looks like this.

Code that is to be typed in the Python interactive shell looks like this :

>>> print('hello')
hello

* The >>> preceding the expression print('hello') doesn't need to be typed, it's what you'll see in your shell when it's ready to receive your commands. Lines without a preceding >>> show the output in response to the expression.

Code that is to be typed at a regular terminal looks like this :

$ echo "hello"
hello

* The $ preceding the command echo "hello" doesn't need to be typed, it's what you'll see in your terminal when it's ready to receive your commands. Lines without a preceding $ show the output in response to the command.

Interludes

Where slightly off-topic topics of interest are presented, look like this.