diff --git a/.gitignore b/.gitignore index 88b03d4..dae5017 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Mac files .DS_Store +.idea/ # Byte-compiled / optimized / DLL files __pycache__/ @@ -102,3 +103,6 @@ ENV/ # mypy .mypy_cache/ + +# emacs +*.*~ \ No newline at end of file diff --git a/README.md b/README.md index ec89b52..7e9971f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,15 @@ + # Class Repository Template This is a repo that serves as a template for a repository for a particular instance of a class for the UWPCE Python Certificate. -A copy of this repo will be made for each class, so that it can be used by the class to share information and for students to submit their work. +# Winter 2018 Classroom Class Repository + +This is a repository used by the UWPCE Python Certificate Program Winter 2018 Classroom based class. + + +It can be used by the class to share information and for students to submit their work. ## Structure of the Repo @@ -15,4 +21,7 @@ The class repo has three top level directories: `students`: Used for the students to submit their work. Each student will create a directory in the students directory in which to put their work. +These materials are available in html rendered version here: + +https://UWPCE-PythonCert-ClassRepos.github.io/Wi2018-Classroom/ diff --git a/examples/Session01/schedule.py b/examples/Session01/schedule.py new file mode 100644 index 0000000..48d7c09 --- /dev/null +++ b/examples/Session01/schedule.py @@ -0,0 +1,44 @@ +""" +Schedule students for lightning talks, winter 2018 +""" +import random + +students = open('students.txt').readlines() + +# remove the header line +del students[0] + +# strip the whitespace +students = [line.strip() for line in students] + +# remove the languages, colon, etc. +students = [line.split(":")[0] for line in students] + +# reverse the first, last names +# separate them: +students = [line.split(",") for line in students] +# put them back together +students = ["{} {}".format(first.strip(), last) for last, first in students] + +# put them in random order +random.shuffle(students) + +# make a list from 1 to 10 +weeks = list(range(2, 11)) + +# make three of them... +weeks = weeks * 4 + +# put the students together with the weeks +schedule = zip(weeks, students) + +# sort it for output +schedule = sorted(schedule) + +# write it to a file (and print to screen) +with open('schedule.txt', 'w') as outfile: + for week, student in schedule: + line = 'week {}: {}\n'.format(week, student) + print(line) + outfile.write(line) + diff --git a/examples/Session01/students.txt b/examples/Session01/students.txt new file mode 100644 index 0000000..2e79dc2 --- /dev/null +++ b/examples/Session01/students.txt @@ -0,0 +1,8 @@ +Name: Languages +Donald Duck +Mickey Mouse +Minnie Mouse +Daisy Duck +Huey Duck +Dewey Duck +Louie Duck diff --git a/materials/LICENSE b/materials/LICENSE new file mode 100644 index 0000000..8b88d6b --- /dev/null +++ b/materials/LICENSE @@ -0,0 +1,98 @@ +Creative Commons Attribution-ShareAlike 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. + +Section 1 – Definitions. + +Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. +Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. +BY-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License. +Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. +Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. +Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. +License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike. +Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. +Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. +Licensor means the individual(s) or entity(ies) granting rights under this Public License. +Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. +Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. +You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. +Section 2 – Scope. + +License grant. +Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: +reproduce and Share the Licensed Material, in whole or in part; and +produce, reproduce, and Share Adapted Material. +Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. +Term. The term of this Public License is specified in Section 6(a). +Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. +Downstream recipients. +Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. +Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply. +No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. +No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). +Other rights. + +Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. +Patent and trademark rights are not licensed under this Public License. +To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. +Section 3 – License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the following conditions. + +Attribution. + +If You Share the Licensed Material (including in modified form), You must: + +retain the following if it is supplied by the Licensor with the Licensed Material: +identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); +a copyright notice; +a notice that refers to this Public License; +a notice that refers to the disclaimer of warranties; +a URI or hyperlink to the Licensed Material to the extent reasonably practicable; +indicate if You modified the Licensed Material and retain an indication of any previous modifications; and +indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. +You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. +If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. +ShareAlike. +In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply. + +The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License. +You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material. +You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply. +Section 4 – Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: + +for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; +if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and +You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. +For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. +Section 5 – Disclaimer of Warranties and Limitation of Liability. + +Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. +To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. +The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. +Section 6 – Term and Termination. + +This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. +Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: + +automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or +upon express reinstatement by the Licensor. +For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. +For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. +Sections 1, 5, 6, 7, and 8 survive termination of this Public License. +Section 7 – Other Terms and Conditions. + +The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. +Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. +Section 8 – Interpretation. + +For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. +To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. +No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. +Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. +Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. + +Creative Commons may be contacted at creativecommons.org. \ No newline at end of file diff --git a/materials/Makefile b/materials/Makefile new file mode 100644 index 0000000..9d0976e --- /dev/null +++ b/materials/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = Py100 +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/materials/build_gh_pages.sh b/materials/build_gh_pages.sh new file mode 100755 index 0000000..7809807 --- /dev/null +++ b/materials/build_gh_pages.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +# simple script to build and push to gh-pages +# designed to be run from master + +# this version used a separate copy of the repo in a parallel dir +# to keep the gh-pages branch nicely separate from the main branch. +# this makes it easier to have the index.html in the root dir +# -- to be nicely served by gh-pages + + +GHPAGESDIR=../../Wi2018-Classroom.gh-pages/ + +# make sure gh-pages dir is there -- exit if not +if [ ! -d $GHPAGESDIR ]; then + echo "To build the gitHub pages, you must first create a parallel repo: $GHPAGESDIR" + exit +fi + +if [ ! -d $GHPAGESDIR/.git ]; then + echo "To build the gitHub pages, you must first create a parallel repo: $GHPAGESDIR" + echo "It must be a git repo -- do a new git clone" + exit +fi + +# make sure that the main branch is pushed, so that pages are in sync with master +git push + +# make sure the gh pages repo is there and in the right branch +pushd $GHPAGESDIR +git checkout -b gh-pages +popd + +# make the docs +make html +# copy to other repo (on the gh-pages branch) +cp -R build/html/ $GHPAGESDIR + +pushd $GHPAGESDIR +git add . # in case there are new files added +git commit -a -m "updating presentation materials" +git pull -s ours --no-edit +git push --set-upstream origin gh-pages + diff --git a/materials/make.bat b/materials/make.bat new file mode 100644 index 0000000..49f9445 --- /dev/null +++ b/materials/make.bat @@ -0,0 +1,36 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build +set SPHINXPROJ=Py100 + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% + +:end +popd diff --git a/materials/requirements.txt b/materials/requirements.txt new file mode 100644 index 0000000..175b81b --- /dev/null +++ b/materials/requirements.txt @@ -0,0 +1,8 @@ +Jinja2 +MarkupSafe +Pygments +Sphinx +docutils +hieroglyph +ipython +libsass diff --git a/materials/source/_static/dummy b/materials/source/_static/dummy new file mode 100644 index 0000000..e69de29 diff --git a/materials/source/_static/python100.png b/materials/source/_static/python100.png new file mode 100644 index 0000000..738f6ed Binary files /dev/null and b/materials/source/_static/python100.png differ diff --git a/materials/source/conf.py b/materials/source/conf.py new file mode 100644 index 0000000..a5e7991 --- /dev/null +++ b/materials/source/conf.py @@ -0,0 +1,214 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Py100 documentation build configuration file, created by +# sphinx-quickstart on Sat Feb 11 22:52:51 2017. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.todo', + 'sphinx.ext.ifconfig', + 'sphinx.ext.viewcode', + 'sphinx.ext.githubpages', + # 'sphinx.ext.pngmath', + 'sphinx.ext.mathjax', + # 'sphinx.ext.jsmath', + 'IPython.sphinxext.ipython_console_highlighting', + 'IPython.sphinxext.ipython_directive', + 'sphinx.ext.intersphinx', +] + +intersphinx_mapping = {'pythoncert': ('https://uwpce-pythoncert.github.io/PythonCertDevel', None)} + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'IntroToPython' +copyright = '2017, Christopher Barker, Cris Ewing, Maria McKinley, ' \ + 'Rick Riehle, Christy Heaton, Joseph Schilz' +author = 'Christopher Barker, Cris Ewing, Maria McKinley, Rick Riehle, ' \ + 'Christy Heaton, Joseph Schilz' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '1.0' +# The full version, including alpha/beta/rc tags. +release = '1.0' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = [] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +# html_theme = 'alabaster' +html_theme = "sphinx_rtd_theme" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'IntroToPython' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'IntroToPython.tex', 'Intro To Python Program Materials', + 'Christopher Barker, Cris Ewing, Maria McKinley, Rick Riehle', 'manual'), +] + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'IntroToPython', 'Intro To Python Class Materials', + [author], 1) +] + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'IntroToPython', 'Intro To Python Program Materials', + author, 'IntroToPython', 'One line description of project.', + 'Miscellaneous'), +] + + +# -- Options for Epub output ---------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project +epub_author = author +epub_publisher = author +epub_copyright = copyright + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = '' + +# A unique identification for the text. +# +# epub_uid = '' + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ['search.html'] + +# -- Hieroglyph Slide Configuration ------------ +# Do we need this anymore?? + +# extensions += [ +# 'hieroglyph', +# ] + +# slide_title = "Intro To Pythonification Program" +# slide_theme = 'slides2' +# slide_levels = 3 +# slide_numbers = False + + +# Place custom static assets in the _static directory and uncomment +# the following lines to include them + +slide_theme_options = { + 'subtitle': 'IntroToPython', + 'custom_css': 'custom.css', + # 'custom_js': 'custom.js', +} diff --git a/materials/source/index.rst b/materials/source/index.rst new file mode 100644 index 0000000..ef82652 --- /dev/null +++ b/materials/source/index.rst @@ -0,0 +1,113 @@ + +############################ +Intro to Python: Winter 2018 +############################ + +.. :ref:`syllabus` + +.. toctree:: + :maxdepth: 1 + + syllabus + +Class Schedule +============== + +Orientation: Jan 10 +.................... + +:ref:`orientation` + +Week 1: Jan 17 +............. + +:ref:`session_1_01` + +Week 2: Jan 24 +.................. + +:ref:`session_1_02` + +:ref:`notes_session02` + +Week 3: Jan 31 +.................. + +:ref:`session_1_03` + +:ref:`notes_session03` + +Week 4: Feb 7 +.................. + +:ref:`session_1_04` + +:ref:`notes_session04` + + +Week 5: Feb 14 +.................. + +:ref:`session_1_05` + +:ref:`notes_session05` + + +Week 6: Feb 21 +.................. + +:ref:`session_1_06` + +:ref:`notes_session06` + + +Week 7: Feb 28 +................... + +:ref:`session_1_07` + +:ref:`notes_session07` + + +Week 8: Mar 7 +................... + +:ref:`session_1_08` + +:ref:`notes_session08` + + +Week 9: Mar 14 +.................. + +:ref:`session_1_09` + +:ref:`notes_session09` + + +Week 10: Mar 21 +.................... + +:ref:`session_1_10` + +:ref:`notes_session10` + + +Supplemental Materials +====================== + +:ref:`installing_python` + +:ref:`setting_up_dev_environment` + +References: +=========== + +:ref:`references` + +Indices and tables +================== + +.. * :ref:`genindex` + +* :ref:`search` diff --git a/materials/source/notes/session01.rst b/materials/source/notes/session01.rst new file mode 100644 index 0000000..a80af54 --- /dev/null +++ b/materials/source/notes/session01.rst @@ -0,0 +1,9 @@ +:orphan: + +.. _notes_session01: + +#################### +Notes for Session 01 +#################### + +Notes for class \ No newline at end of file diff --git a/materials/source/notes/session02.rst b/materials/source/notes/session02.rst new file mode 100644 index 0000000..15376cb --- /dev/null +++ b/materials/source/notes/session02.rst @@ -0,0 +1,9 @@ +:orphan: + +.. _notes_session02: + +#################### +Notes for Session 02 +#################### + +Notes for class \ No newline at end of file diff --git a/materials/source/notes/session03.rst b/materials/source/notes/session03.rst new file mode 100644 index 0000000..80b2978 --- /dev/null +++ b/materials/source/notes/session03.rst @@ -0,0 +1,9 @@ +:orphan: + +.. _notes_session03: + +#################### +Notes for Session 03 +#################### + +Notes for class \ No newline at end of file diff --git a/materials/source/notes/session04.rst b/materials/source/notes/session04.rst new file mode 100644 index 0000000..01e9124 --- /dev/null +++ b/materials/source/notes/session04.rst @@ -0,0 +1,9 @@ +:orphan: + +.. _notes_session04: + +#################### +Notes for Session 04 +#################### + +Notes for class \ No newline at end of file diff --git a/materials/source/notes/session05.rst b/materials/source/notes/session05.rst new file mode 100644 index 0000000..c4e20bc --- /dev/null +++ b/materials/source/notes/session05.rst @@ -0,0 +1,9 @@ +:orphan: + +.. _notes_session05: + +#################### +Notes for Session 05 +#################### + +Notes for class \ No newline at end of file diff --git a/materials/source/notes/session06.rst b/materials/source/notes/session06.rst new file mode 100644 index 0000000..89ef549 --- /dev/null +++ b/materials/source/notes/session06.rst @@ -0,0 +1,9 @@ +:orphan: + +.. _notes_session06: + +#################### +Notes for Session 06 +#################### + +Notes for class \ No newline at end of file diff --git a/materials/source/notes/session07.rst b/materials/source/notes/session07.rst new file mode 100644 index 0000000..15955c5 --- /dev/null +++ b/materials/source/notes/session07.rst @@ -0,0 +1,9 @@ +:orphan: + +.. _notes_session07: + +#################### +Notes for Session 07 +#################### + +Notes for class \ No newline at end of file diff --git a/materials/source/notes/session08.rst b/materials/source/notes/session08.rst new file mode 100644 index 0000000..e1a37c4 --- /dev/null +++ b/materials/source/notes/session08.rst @@ -0,0 +1,9 @@ +:orphan: + +.. _notes_session08: + +#################### +Notes for Session 08 +#################### + +Notes for class \ No newline at end of file diff --git a/materials/source/notes/session09.rst b/materials/source/notes/session09.rst new file mode 100644 index 0000000..916e81c --- /dev/null +++ b/materials/source/notes/session09.rst @@ -0,0 +1,9 @@ +:orphan: + +.. _notes_session09: + +#################### +Notes for Session 09 +#################### + +Notes for class \ No newline at end of file diff --git a/materials/source/notes/session10.rst b/materials/source/notes/session10.rst new file mode 100644 index 0000000..7b0f8e7 --- /dev/null +++ b/materials/source/notes/session10.rst @@ -0,0 +1,9 @@ +:orphan: + +.. _notes_session10: + +#################### +Notes for Session 10 +#################### + +Notes for class \ No newline at end of file diff --git a/materials/source/syllabus.rst b/materials/source/syllabus.rst new file mode 100644 index 0000000..8fcf916 --- /dev/null +++ b/materials/source/syllabus.rst @@ -0,0 +1,169 @@ +.. _syllabus: + +##################### +PYTHON 210B Syllabus +##################### + +.. image:: ./_static/python100.png + +UW Adult and Continuing Education Program +============================================ + +Certification in Python Programming: Program Description +--------------------------------------------------------- + +The Python Certificate program is a 9-month curriculum divided into three courses. By the end of the program students will have gained a fundamental understanding of programming in Python by creating a variety of scripts and applications for the Web and for systems development. Python is a versatile programming language, suitable for projects ranging from small scripts to large systems. The certificate program emphasizes best practices such as version control, unit testing and recommended styles and idioms. Students will explore the large standard library of Python 3.6, which supports many common programming tasks. + +First Course: Introduction to Python +==================================== + +Wednesdays 6-9 pm: Jan 17 - Mar 21, 2017 (10 Sessions) +------------------------------------------------------ + +NOTE: in the spirit of the dynamic nature of Python, this Syllabus (and the class) will be a dynamic document -- evolving as the class progresses. The general structure is fixed, but the details will change to meet the evolving needs of the class. + +Learning Goals +============== + +By the end of this course, students will be able to “do something useful with Python”. + * Identify/characterize/define a problem + * Design a program to solve the problem + * Create executable code + * Read most Python code + * Write basic unit tests + +Approach: +========= +This class assumes a basic knowledge of programming. Thus I will try to emphasize what is unique about Python, with less focus on general programing concepts. + +One learns programming by doing -- I'll be demonstrating as I talk about concepts, and I will pause frequently to give you a chance to try things out, so plan on having a laptop up and running with python and your text editor of choice during each class. + +We will be using a combination of traditional lecture format and +`"Flipped Classroom" `_ approach -- We will generally have reading (or video) assignments that cover a topic, and then in class, we will work through exercises as a group to cement your understanding. We will also be doing frequent "pair programming" -- teaming the students up in pairs to work through exercises together. + +Logistics +========= +Location: Puget Sound Plaza, 4th and Union, Seattle + +Room 406 (4th floor) + +Wednesday nights, 6 - 9pm: Jan 17 - Mar 21, 2017 (10 Sessions) + +Your Instructors: +----------------- + +Maria Mckinley -- parody@uw.edu + +Summer Rae -- summerrae78@gmail.com + +Course website: https://github.com/UWPCE-PythonCert-ClassRepos/Wi2018-Classroom + + +Python Version: +=============== + +There are two main supported versions of Python: the 2.* series and the 3.* series (py3k). In this class we will be using "cPython" version 3.6, the version distributed by `python.org `_. Each student is expected to have access to a laptop with permission to install software -- both during class and for homework assignments. Any modern operating system is fine: OS-X, Linux, or Windows. + +Note that Python3 and Python2 have some slightly different syntax and semantics. Many of the examples you will find on the web are in Python2 syntax. We will cover the differences early in class so you will know how to translate. + +Assignments And Assessment +=========================== + +Homework: +--------- +There will generally be weekly homework assignments. They will include primarily reading and video watching and completing programming exercises started in class. You are not required to turn in the assignments to pass the course, however, we learn by doing, so I do encourage you to put some time in to the homework. we will review your work if you submit it, and do mini code-reviews of selected assignments during class. + +`Teach Yourself Programming in Ten Years `_ + + +Lightning Talks: +----------------- + +Each student is expected to give one "lightning talk" during the class -- this is a simple 5-minute talk on something related to Python -- totally up to you. We will randomly assign the talks schedule (using Python, of course) during the first class. + +Grading And Attendance +---------------------- + +This course is graded pass/fail, based on attendance and participation in class. Students are required to attend at least 8 of the 10 classes. + +Policies And Values +------------------- + +Active learning requires students to participate in the class, as opposed to sitting and listening quietly. In class students will follow the instructor in creating demonstrative examples. Outside of class, students are expected to read the assignments, perform the homework, and post questions (about recent session topics) that they have on the class mailing list or slack before the next class session. Other students are strongly encouraged to answer these questions if possible. Answers to common and unanswered questions will be reviewed in the next class session. + +Your feedback on the course and instruction +------------------------------------------- + +After the 3rd class session, we solicit anonymous feedback from all students regarding the pacing and instruction of the course. Students will also be invited to provide comments at the end of the course. + +Student Handbook +----------------- + +The student handbook can be found online http://www.pce.uw.edu/resources/certificates/ + +Communication +============= + +Office Hours: +------------- + +Physical location to be determined week to week. + +Usually Saturdays and Sundays, 10:00 a.m. to noon Pacific Time (Seattle time) but day and time may change week to week. + +Office hours are completely optional + +Slack +----- + +We will be using Slack for communication. Join us there. + +https://pythonwinter2018.slack.com + +If you have a uw email address, you should be able to join here, otherwise email one of your instructors for an invite + +https://join.slack.com/t/pythonwinter2018/signup + +gitHub +------ + +All class materials will be up on gitHub (where you probably found this). This allows me to update things at the last minute, and the students can all have easy access to the latest versions. It also familiarizes you with a very useful tool for software development. + +We will also be using gitHub to communicate during the class -- turn in assignments, post questions, etc. + +We'll spend a bit of time during the first couple classes getting everyone up and running with git and gitHub. + +https://github.com/UWPCE-PythonCert-ClassRepos/Wi2018-Classroom + +for rendered and ready to read version of the class lecture notes: + +https://UWPCE-PythonCert-ClassRepos.github.io/Wi2018-Classroom + +Mailinglist +----------- + +There is a mailing list for the class: + +python210b_wi18@uw.edu + +Please let us know if you have not received any emails through the mailing lsit. + +Course Textbook +--------------- + +There is no textbook to purchase. + +We have determined over time that a one-size-fits-all approach does not work well for the diverse skills and backgrounds of students in class. Thus, rather than requiring that everyone purchase a single text, we supply many resources, most of which are free (as in free beer) and available online. + +We also encourage you to purchase or find your own texts and references. If you have a special interest in, for instance, data visualization, machine learning or game programming, find a reference and bring it and your questions to class and/or weekly office hours. By the time you get to the third course in the series this will feel natural. Indeed it is the way we work as professionals in the field, each of us individually or in small teams finding the tools and resources we need to further our interests, skills and careers. + +A few you may want to consider: :ref:`python_learning_resources` + +Disability Accommodation +======================== + +Your experience in this class is important to us, and it is the policy and practice of the University of Washington to create inclusive and accessible learning environments consistent with federal and state law. If you experience barriers based on disability, please seek a meeting with DRS to discuss and address them. If you have already established accommodations with DRS, please communicate your approved accommodations to your instructor at your earliest convenience so we can discuss your needs in this course. + +Disability Resources for Students (DRS) offers resources and coordinates reasonable accommodations for students with disabilities. Reasonable accommodations are established through an interactive process between you, your instructor(s) and DRS. If you have not yet established services through DRS, but have a temporary or permanent disability that requires accommodations (this can include but not limited to; mental health, attention-related, learning, vision, hearing, physical or health impacts), you are welcome to contact DRS at 206-543-8924 or uwdrs@uw.edu or disability.uw.edu + + diff --git a/students/00-README.md b/students/00-README.md index cae5eae..f0e7ecc 100644 --- a/students/00-README.md +++ b/students/00-README.md @@ -2,10 +2,13 @@ When you join the course, please do the following: -1. Create a directory named after you. This is a public repository, so if you want to reamin anonymous, you don't need to use your full name. + + +1. Create a directory named after you. This is a public repository, so if you want to remain anonymous, you don't need to use your full name. - It can be your first name - It can be your gitHub handle - - It can be an arbitrary nick name -- just make sure to let your instructor know + - It can be an arbitrary nickname -- just make sure to let your instructor know + 2. Create a README for your directory. * Feel free to personalize it a bit! diff --git a/students/ravi/readme.txt b/students/ravi/readme.txt new file mode 100644 index 0000000..5078012 --- /dev/null +++ b/students/ravi/readme.txt @@ -0,0 +1 @@ +Hi There! This is Ravi. diff --git a/students/shawn/class_02/class_02.py b/students/shawn/class_02/class_02.py new file mode 100644 index 0000000..22d3c10 --- /dev/null +++ b/students/shawn/class_02/class_02.py @@ -0,0 +1,70 @@ +# Class 02 Exercises +def print_grid(cols=2, rows=2, width=5, height=5): + """Grid Printer Exercise - Print a grid of cols x rows with cells width x height""" + sline = [] #separator line + bline = [] #body line + sep = "" + body = "" + for col in range(cols): + sline.append("-" * width) + sep="+{}+".format("+".join(sline)) + bline.append(" " * width) + body="|{}|".format("|".join(bline)) + + for row in range(rows): + is_sep = True + for h in range(height): + if is_sep: + print(sep) + else: + print(body) + is_sep = False + + print(sep) + + +print_grid(cols=5, rows=5,width=5,height=5) + +############################################################# + +def fizz_buzz(): + """Fizz Buzz Exercise""" + for i in range(1,100): + is_fiz = i%3==False + is_buz = i%5==False + + if (is_fiz and is_buz): + print("FizzBuzz") + elif is_fiz: + print("Fizz") + elif is_buz: + print("Buzz") + else: + print (i) + + +fizz_buzz() + +############################################################# + +from enum import Enum + +# Instead of redundant functions, add series type as keyword enum to remove ambiguity +class Series(Enum): + Fibonacci = 1 + Lucas = 2 + +def fib_luc(nth,series=Series.Lucas): + """Return the nth number of either the Lucas or Fibonacci series""" + + list=[0,1] if series == Series.Fibonacci else [2,1] + for i in range(2,nth): + val=list[i-2] + list[i-1] + list.append(val) + + print(list[-1]) + +fib_luc(15,series = Series.Fibonacci) + + +fib_luc(15,series = Series.Lucas) diff --git a/students/shawn/readme.txt b/students/shawn/readme.txt new file mode 100644 index 0000000..30d74d2 --- /dev/null +++ b/students/shawn/readme.txt @@ -0,0 +1 @@ +test \ No newline at end of file