From 9b30e8cf6ccc901c01476660f3c6905dd663eb61 Mon Sep 17 00:00:00 2001 From: danieldh206 Date: Mon, 10 May 2021 22:32:06 -0700 Subject: [PATCH 1/7] Update html_renderer_tutorial.rst Line 269 needs to be correct so lines 324 through 329 are correct. Daniel --- source/exercises/html_renderer/html_renderer_tutorial.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exercises/html_renderer/html_renderer_tutorial.rst b/source/exercises/html_renderer/html_renderer_tutorial.rst index f34f2c4..6539107 100644 --- a/source/exercises/html_renderer/html_renderer_tutorial.rst +++ b/source/exercises/html_renderer/html_renderer_tutorial.rst @@ -266,7 +266,7 @@ So the method looks something like this: for content in self.contents: out_file.write(content) out_file.write("\n") - out_file.write("\n".format(self.tag)) + out_file.write("\n".format(self.tag)) Now run the tests again:: From 5ffb85ae224a48a65876e83c969635741d306982 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Thu, 6 Jan 2022 20:44:10 -0800 Subject: [PATCH 2/7] fixed some typos --- source/modules/Decorators.rst | 3 +-- .../topics/01-setting_up/github_classroom.rst | 27 ++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/source/modules/Decorators.rst b/source/modules/Decorators.rst index 4234f11..105cc64 100644 --- a/source/modules/Decorators.rst +++ b/source/modules/Decorators.rst @@ -43,8 +43,7 @@ So many, that we give it a special name: An Example ---------- -Imagine you are trying to debug a module with a number of functions like this -one: +Imagine you are trying to debug a module with a number of functions like this one: .. code-block:: python diff --git a/source/topics/01-setting_up/github_classroom.rst b/source/topics/01-setting_up/github_classroom.rst index 8f54f6c..36274ee 100644 --- a/source/topics/01-setting_up/github_classroom.rst +++ b/source/topics/01-setting_up/github_classroom.rst @@ -33,7 +33,9 @@ Initial Setup ============= You will need an account on gitHub to participate in this course. -If you don't already have a gitHub account, or if you would prefer to create a new one for this course, make sure you setup a new account on `gitHub `_. Always keep in mind that your account name will be part of the private repositories that will be created for each of your assignments and it will be visible to both your instructors and your classmates. Make sure you let your instructors know what your gitHub handle is -- it's not always obvious! +If you don't already have a gitHub account, or if you would prefer to create a new one for this course, make sure you setup a new account on `gitHub `_. +Always keep in mind that your account name will be part of the private repositories that will be created for each of your assignments and it will be visible to both your instructors and your classmates. +Make sure you let your instructors know what your gitHub handle is -- it's not always obvious! You will need to have git setup on the computer you will use for developing your code for this course. You can find instructions for setting up git (and the rest of your development environment) here: @@ -142,19 +144,19 @@ b) Make a new branch: After that command, git will be "in" the develop branch -- anything you change will only be reflected in that branch. -.. note:: A git "branch" is an independent "version" of your code where you can write and change code, create and delete files, etc, and it will be kept separate from the main code. When you are happy with this version, it can be merged into the main branch. For the purposed of this course, it will not be merged into the main branch until it has been reviewed, and both you and your instructors think its done. +.. note:: A git "branch" is an independent "version" of your code where you can write and change code, create and delete files, etc, and it will be kept separate from the main code. When you are happy with this version, it can be merged into the main branch. For the purposed of this course, it will not be merged into the main branch until it has been reviewed, and both you and your instructors think it's done. If you get an error from this command that says:: fatal: A branch named 'develop' already exists -That means two things: +That means one of two things: - 1) You have already created a develop branch. IN which case you chould already be using it, or you can "check it out" again: `git checkout develop` + 1) You have already created a develop branch. In which case you should already be using it, or you can "check it out" again: `git checkout develop` or - 2) That branch was created already by gitHub classroom. Which you'd think would be nice, but it turns out that the way it's created doesn't allow the next steps: the Pull Request. THe solution in this case is to use a different name for your working branch, e.g. + 2) That branch was created already by gitHub classroom. Which you'd think would be nice, but it turns out that the way it's created doesn't allow the next steps: the Pull Request. The solution in this case is to use a different name for your working branch, e.g. :: @@ -204,7 +206,7 @@ b) Commit your work. When you have gotten to a good "pause point" in your work: (use "git restore ..." to discard changes in working directory) modified: install_test.py -note that in this case, I edited the ``install_test.py`` file after adding it. When you edit a file, git will not track those changes unless you tell it to, which you can do by running ``git add`` again. So ``git add`` tells git that you want it to keep track of that file -- called "staging for commit":: +Note that in this case, I edited the ``install_test.py`` file after adding it. When you edit a file, git will not track those changes unless you tell it to, which you can do by running ``git add`` again. So ``git add`` tells git that you want it to keep track of that file -- called "staging for commit":: $ git add install_test.py @@ -234,12 +236,12 @@ There is a trick to save a step -- you can ask git to commit all changes you've create mode 100644 another_file.py create mode 100644 install_test.py -The ``-a`` means "all". Note that you still need to use ``git add`` to ask git to track a new file that it is not already managing. +The ``-a`` means "all". Note that you still need to use ``git add`` to ask git to track a new file that it is not already managing. And be sure to run ``git status`` first to make sure you haven't accidentally added things you didn't want to. 5) Push your work to gitHub --------------------------- -All this adding and committing has only affected the repository on your own machine -- gitHub has not been changed. +All this adding and committing has only affected the repository on your own machine -- the one on gitHub has not been changed. In order to get your changes up to gitHub you need to "push" them. It's always a good idea to check the status before you push -- to make sure you're ready. :: @@ -258,7 +260,8 @@ Note that I am on the "develop" branch, which is what's wanted, and nothing new git push --set-upstream origin develop -Hmm -- "fatal" -- I don't like the look of that! But it's pretty simple, really. git is telling you that it doesn't know where to push the code to -- your gitHub version of the repo doesn't have a develop branch. But it tells you want to do to create that branch on gitHub (origin), so do that: +Hmm -- **fatal** -- I don't like the look of that! +But it's pretty simple, really. git is telling you that it doesn't know where to push the code to -- your gitHub version of the repo doesn't have a develop branch. But it tells you want to do to create that branch on gitHub (origin), so do that: :: @@ -327,7 +330,7 @@ Put a link to the PR in the LMS, to let us know that you have "turned in" the as 8) Wait for review ------------------ -Once you make your PR, your instructors will be notified by gitHub (and the LMS), and will review your code. They can make general comments, or comment line by line. When a review is done, you should get an email form gitHub. But you can always go and check the PR yourself and see if anything new is there. +Once you make your PR, your instructors will be notified by gitHub (and the LMS), and will review your code. They can make general comments, or comment line by line. When a review is done, you should get an email from gitHub. But you can always go and check the PR yourself and see if anything new is there. At this point, two things might happen. @@ -413,7 +416,7 @@ After adding the file(s), you can commit your code by typing the following:: Note that the commit message should be replaced with something descriptive of what that commit includes ("added new functionality", "fixed floating point error", "ready for review", etc.) that will later help you remember what that particular commit was about. -.. note:: If you omit the message, git will bring up a text editor to let you write one. If you have not configured git to use another editor, it will be "vi", an venerable old Unix editor that is a real challenge for some. To get out of vi, hit the >escape> key, the a colon and an x: ``:x``. You can configure git to use an editor you are familiar with. See: :ref:`install_nano_win` for how to do that on Windows. +.. note:: If you omit the message, git will bring up a text editor to let you write one. If you have not configured git to use another editor, it will be "vi", a venerable old Unix editor that is a real challenge for some. To get out of vi, hit the key, the a colon and an x: ``:x``. You can configure git to use an editor you are familiar with. See: :ref:`install_nano_win` for how to do that on Windows. After every change to the file, you will need to "commit" the changes. Keep in mind that git will not commit all the changes you have made, only the ones that are "staged for commit". You can stage them with the ``git add`` command again. So ``add`` means either "add this file" or "stage this file for committing", depending on whether it's already been added or not. @@ -460,7 +463,7 @@ When you submit a comment with a tag, the instructor will be notified by gitHub Submitting your assignment -------------------------- -Once your assignment is ready for review, copy the link of your Feedback pull request and submit it in the submission form. Here is an example of a submission link (yours will look a little different but will end with `/pull/1`):: +Once your assignment is ready for review, copy the link of your Feedback Pull Request and submit it in the submission form. Here is an example of a submission link (yours will look a little different but will end with `/pull/1`):: https://github.com/UWPCE-Py210-SelfPaced-2021/lesson-02-fizzbuzz-exercise-uw-test-student-natasha/pull/1 From fe85c1f7ffb32f0db64692cff97494d71fb08f10 Mon Sep 17 00:00:00 2001 From: Natasha Date: Thu, 10 Mar 2022 16:13:07 -0800 Subject: [PATCH 3/7] Update mailroom_with_dicts.rst --- source/exercises/mailroom/mailroom_with_dicts.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/exercises/mailroom/mailroom_with_dicts.rst b/source/exercises/mailroom/mailroom_with_dicts.rst index b627c18..24cad30 100644 --- a/source/exercises/mailroom/mailroom_with_dicts.rst +++ b/source/exercises/mailroom/mailroom_with_dicts.rst @@ -15,13 +15,13 @@ However, using dictionaries, an import built in data structure in Python, will l Update your mailroom program to: + - Convert your main donor data structure to be a dict. Think about an appropriate key for easy donations look up. + - Use dicts where appropriate. - - See if you can use a dict to switch between the users selections. + - Use a dict to switch between the users selections. see :ref:`dict_as_switch` for what this means. - - Convert your main donor data structure to be a dict. - - Try to use a dict and the ``.format()`` method to produce the letter as one big template, rather than building up a big string that produces the letter in parts. From 703382e585426ac65de3afd7082a046fba13e1d3 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Thu, 10 Mar 2022 23:53:59 -0800 Subject: [PATCH 4/7] a bit more copy editing --- source/exercises/mailroom/mailroom_with_dicts.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/exercises/mailroom/mailroom_with_dicts.rst b/source/exercises/mailroom/mailroom_with_dicts.rst index 24cad30..d0a46e9 100644 --- a/source/exercises/mailroom/mailroom_with_dicts.rst +++ b/source/exercises/mailroom/mailroom_with_dicts.rst @@ -11,19 +11,18 @@ Use dicts where appropriate. The first version of this assignment used these basic data types: numbers, strings, lists and tuples. -However, using dictionaries, an import built in data structure in Python, will let you re-write your program a bit more simply and efficiently. +However, using dictionaries, an important built in data structure in Python, will let you re-write your program a bit more simply and efficiently. Update your mailroom program to: - - Convert your main donor data structure to be a dict. Think about an appropriate key for easy donations look up. + - Convert your main donor data structure to be a dict. Think about an appropriate key for easy donor look up. - - Use dicts where appropriate. + - Use dicts anywhere else, as appropriate. - Use a dict to switch between the users selections. see :ref:`dict_as_switch` for what this means. - - Try to use a dict and the ``.format()`` method to produce the letter as one - big template, rather than building up a big string that produces the letter in parts. + - Use a dict and the ``.format()`` method to produce the letter as one big template, rather than building up a big string that produces the letter in parts. Example: From d9fa5d8e653fc443488bb72cec871d6c81e665f1 Mon Sep 17 00:00:00 2001 From: "Christopher H.Barker, PhD" Date: Wed, 25 May 2022 07:55:01 -0700 Subject: [PATCH 5/7] removed a dead link --- source/modules/Modules.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/modules/Modules.rst b/source/modules/Modules.rst index b71efd3..d55caef 100644 --- a/source/modules/Modules.rst +++ b/source/modules/Modules.rst @@ -388,11 +388,13 @@ In that case, you can simply add more "dots" and follow the same rules as above. from packagename import my_funcs.this_func -Here's a nice reference for more detail: +.. Here's a nice reference for more detail: -http://effbot.org/zone/import-confusion.htm +.. http://effbot.org/zone/import-confusion.htm -And :ref:`packaging` goes into more detail about creating (and distributing!) your own package. +.. And + +:ref:`packaging` goes into more detail about creating (and distributing!) your own package. What does ``import`` actually do? From e5e90abb046c62c4e09ffd064b892379b03e23a5 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Wed, 25 May 2022 08:09:05 -0700 Subject: [PATCH 6/7] bold fix and rename to 310 --- README.md | 4 ++-- source/class_schedule/index.rst | 2 +- source/modules/Modules.rst | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 124083e..417bd7a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Python210CourseMaterials +# Python310CourseMaterials -Course Materials for Python 210 +Course Materials for Python 310: the first course in the UWPCE Python Certificate Program. Published here: diff --git a/source/class_schedule/index.rst b/source/class_schedule/index.rst index 27cf4f0..764b8b2 100644 --- a/source/class_schedule/index.rst +++ b/source/class_schedule/index.rst @@ -1,7 +1,7 @@ :orphan: ######################### -Python 210 Class Schedule +Python 310 Class Schedule ######################### .. toctree:: diff --git a/source/modules/Modules.rst b/source/modules/Modules.rst index d55caef..cffdc50 100644 --- a/source/modules/Modules.rst +++ b/source/modules/Modules.rst @@ -84,7 +84,7 @@ But you should strive for proper style. Isn't this easier to read? x = (3 * 4) + (12 / func(x, y, z)) -.. centered:: **Read** `**PEP 8** `_ **and install a linter in your editor.** +.. centered:: **Read** `PEP 8 `_ **and install a linter in your editor.** Modules and Packages From 9e33211c2cfc3f45bdb62d6b5f6f4420a74a7745 Mon Sep 17 00:00:00 2001 From: Max-Type <160228942+Max-Type@users.noreply.github.com> Date: Fri, 16 Feb 2024 11:27:47 +0100 Subject: [PATCH 7/7] Fix Typo --- source/modules/Modules.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/modules/Modules.rst b/source/modules/Modules.rst index cffdc50..bfc0dd3 100644 --- a/source/modules/Modules.rst +++ b/source/modules/Modules.rst @@ -485,6 +485,6 @@ Running ``mod2.py`` results in:: Still in mod2: mod1.x = 555 mod3 changed the value in mod1, and that change shows up in mod2 -You can see that when ``mod2`` changed the value of ``mod1.x``, that changed the value everywhere that ``mod1`` is imported. You want to be very careful about this. +You can see that when ``mod3`` changed the value of ``mod1.x``, that changed the value everywhere that ``mod1`` is imported. You want to be very careful about this. If you are writing ``mod2.py``, and did not write ``mod3`` (or wrote it long enough ago that you don't remember its details), you might be very surprised that a value in ``mod1`` changes simply because you imported ``mod3``. This is known as a "side effect", and you generally want to avoid them!