Skip to content

MrBrezina/python-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python workshop for MATD students

Students to-do list

Agenda

A very brief intro to Python 2.x, its use in font engineering and type design. Optionally, an intro into Git.

Thursday morning (9:30–13:00)

  • basic concepts
    • expressions
    • variables
    • types
    • mutable vs. immutable types
    • methods
    • assignment
    • commands
    • blocks (indentation)
  • environments (Python interactive mode, Python command, Atom with Script package, font editors, …)
  • note on naming variables
  • basic types (None, int (integer), float, bool (boolean), tuple)
  • arithmetic operations (+, -, *, /, %, ()), priority
  • comparisons (==, <, >, !=, <>, <=, >=, in, not in, is, is not)
  • boolean operations (and, or, not, ())
  • basic commands
    • assignments (=, +=, -=)
    • print
    • comment
  • ☕️
  • conditionals (if, elif, else)
    • note on indentation
    • nested conditionals
  • strings (str)
    • accessing items in strings
    • string operations (+, *)
    • escape and special characters (\", \n, \t, \\)
    • multi-line strings
    • unicode strings
    • formatting strings (also with a tuple)
    • string methods (startswith, endswith, join, split)
  • tuples (tuple)
    • accessing items in tuples
    • modifying tuples
    • packing, unpacking
  • error messages
  • task: try to code and run simple Python scripts in Atom

Thursday afternoon (14:00–17:00)

  • lists (list)
    • creating lists
    • assignment does not create new list
    • accessing list items
    • nested lists
    • list operations (+, *, in)
    • list and string slicing
    • list methods (append, extend, insert, sort, reverse, index)
    • list functions (sorted, reversed, sum, len, range, min, max)
    • removing items from lists
  • iterative loops (for)
    • looping over list or range
    • nesting loops
    • loops with conditionals nested
    • using indexes
    • mention while loops
  • task: write scripts with loops
  • ☕️
  • dictionaries (dict)
    • creating new dictionary
    • adding an item to a dict, changing an item
    • what can be a key
    • dictionary methods (keys, values, items)
    • iterating over dictionary (conversion to list happens)
    • testing if key exists (in)
  • built-in functions
    • re-typing (int, str, list, …)
    • enumerate
    • zip and creating dict from lists
    • abs
  • introduction to Drawbot
  • task: write scripts for DrawBot
  • 🍺🍟

Friday morning (9:30–13:00)

  • functions (def)
    • parameters
    • returning value
  • modules (import)
  • note on name spaces
  • ☕️
  • task: advanced code with DrawBot

Friday afternoon (14:00–17:00)

  • introduction to Glyphs API
  • task: write scripts for Glyphs
  • ☕️
  • task: write scripts for Glyphs
  • explain Git
  • task: work with this repo
    • clone this repo
    • create your own forder within the repo
    • push the changes to the GitHub
    • pull other students’ commits
  • 🚀

Additional topics not covered in this workshop

  • set type
  • while loop
  • break, else, continue statements used with loops
  • dealing with exceptions (try, except)
  • object oriented programming

Resources

About

Python workshop for the MATD 2015

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages