for musicians and composers
Part One - Fundamentals
Setting up the working environment Installing Python 3.7 · Choosing a text editor · Virtual environments · Git
On Being (Pythonic)
Built-in data types
Numeric types int · float · Arithmetic
Container types list · tuple · "of arbitrary objects" · str · set · dict · Arithmetic operators on container types
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
Logic Truth · Relational operators · Boolean operators
Presence and identity in · is
Iteration for, in · break · continue · Comprehensions · while
Built-in functions map, filter · any, all
Exceptions try, except, finally
- Modules and packages
Part Two - The standard library
Part Three - The craft by example
Appendix : The surface of things
A review of Python's syntax.
Appendix : The music theory primer
An introduction to the music theory requirements for this book.
Code that is written inline with the text looks
Code that is to be typed in the Python interactive shell looks like this :
>>> print('hello') hello
>>> preceding the expression
need to be typed, it's what you'll see in your shell when it's ready to receive your commands. Lines without a
>>> show the output in response to the expression.
Code that is to be typed at a regular terminal looks like this :
$ echo "hello" hello
$ 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.
Where slightly off-topic topics of interest are presented, look like this.