Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Five Things You Didn't Know Python Could Do!

Five Things You Didn't Know Python Could Do!

All Things Open 2018 - Raleigh, NC
Morning Keynote

Nina Zakharenko

October 24, 2018
Tweet

More Decks by Nina Zakharenko

Other Decks in Technology

Transcript

  1. @nnja """ Python version of https://www.openprocessing.org/sketc by Saskia Freeke """

    t = 0.0 theta = 0.0 max_frame_count = 200 def draw(): background("#242949") translate(width / 2, height / 2) t = float(frameCount) / max_frame_count theta = TWO_PI * t for x in xrange(-175, 176, 25): for y in xrange(-100, 156, 50): offSet = float(50 * x + y + y) x2 = float(map(cos(-theta + offSet), 0, 1, y2 = float(map(cos(-theta + offSet), 0, 1, sz2 = float(map(sin(-theta + offSet), 0, 1 PROCESSING.PY
  2. @nnja while True: for marker in range(11, 0, -1): for

    x in range(0, marker+1): mult_r = x / 12 mult_g = (x + 5) / 12 mult_b = (x + 10) / 12 r = gamma[wheel(int((x / 12) * 150))[0]] g = gamma[wheel(int((x / 12) * 150))[1]] b = gamma[wheel(int((x / 12) * 150))[2]] pixels[x] = (r, g, b) r = gamma[wheel(int((x-1 / 12) * 150))[0]] github.com/nnja/pyearrings
  3. @nnja Credits Special thanks to all the people who made

    and released these awesome resources for free: › Presentation template by SlidesCarnival › Photo by David Clode on Unsplash