Skip to content

BornaIz/python-workshop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Python workshop for MATD students

Students to-do list

Agenda

A very brief intro to Python 2 and its use in font engineering and type design.

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
  • ☕️ tea break
  • 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
  • task: advanced code with DrawBot

Friday afternoon (14:00–17:00)

  • introduction to Glyphs API (alternatively Robofab)
  • task: write scripts for Glyphs
  • ☕️ tea break
  • task: write scripts for Glyphs
  • 🚀home

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

  • Python 100.0%