Here was my Lesson 07 of 10 for Saisoft.net (July 2016). I've been doing a series of Python courses for them, as shown in earlier postings to this archive. In a followup post, I'll list some of the Jupyter Notebooks we toured, plus the one I've developed for MathFuture (a Google Goup).
I'm finding this a fruitful approach: * start with Anaconda distro * use Spyder for IDE but also demonstrate "bare command line + vim" type dev styles * take Python fluency developed in Spyder and copy-paste-adapt to Jupyter Notebooks * go back to IDE, but keep using JN. I show the Raspberry Pi as a physical device on camera and suggest getting one, case might be 3D printed. We don't actually try making the Pi join us on zoom.us (our multimedia teaching platform), but that's an experiment I might try. I refer to the REPL as my "chalk board", "scratch sheet", "doodle pad","chat window" (chatting with Python) as well as my "repl" The editor window is more self explanatory. Spyder gives us the green Run Arrow to merge "__main__" with the doodle pad's namespace. Useful to write scripts, run, then doodle with the created functions and classes. For semantics I go: * basic primitives, including datatypes, dir() help() type() * functions along with ** and * * collections.namedtuple --> explicit class-based version * classes, inheritance * instance, class, static methods (sans decorator) * generators, decorators, context managers, descriptors But always with spiraling i.e. we keep going back to the beginning and iterating through a bunch of stuff. Kirby # -*- coding: utf-8 -*- """ Created on Tue Jul 26, 2016 Course: PYT-PR (Saisoft.net) Session 07 Kirby Urner Instructor: kirby.ur...@gmail.com @thekirbster Audio Check (6:15 PM PDT) Introduction: Python's Pillar Communities (three of many) web developers API (Django, Web2py, Flask, Pyramid...) STEM professionals (Anaconda / scipy / Enthought...) Animation / Graphics (pillow, Blender, vpython, pi3d) Continuing from last week: Example API: File Type Objects (returned by open()) Types: filetype, enumerate, sys, sys.argv Writing a command line utility LAB 1: write utility to print python source to console w/ line numbers Shifting gears... Jupyter Notebooks (come for free with Anaconda distro) ($ pip install will get you there too) Periodic Table in Jupyter Notebook http://nbviewer.jupyter.org/... github/4dsolutions/Python5/blob/master/Atoms%20in%20Python.ipynb LAB 2: get 'Atoms R Us' NB running on your localhost unittest and the importance of unit testing (PyUnit from JUnit) pytest, nose.... 3rd party offerings are great too! LAB 3: add more unittesting methods to Atoms R Us and/or adapt the Movie Database API code to Jupyter context Tour of more Jupyter Notebooks with hints of upcoming topics (decorator @) (generator yield) (with) Summary of Session 07 """
_______________________________________________ Edu-sig mailing list Edu-sig@python.org https://mail.python.org/mailman/listinfo/edu-sig