Intro to
Programming
(with Python)

Fall 2016
course
navigation

Tue Sep 6

Questions about anything ?

installing software : getting up and running on windows ...

We discussed this last week, but I'd like to check in to see where you all are.
One person had a problem with GitBash on windows : python would get stuck. I looked into this, and found the same problem, which is discussed here : stackoverflow - python getting stuck in windows git bash .
The fix seems to be to type "winpty python" rather than "python" at the command prompt. (The problem is a bug in the GitBash terminal; this runs a different terminal within that one.) This fix can be made invisible with the "alias" command, i.e. 'alias python="winpty python "'. That will run each time the GitBash shell is started if it's put into ~/.bashrc (Note that files beginning with period are 'invisible' files which are commonly used for settings.) This may then cause another small issue - that gitbash will complain that it isn't finding the other bash invisible files like .profile . If so, you can create a zero size version of each with "touch" , like this :
$ cd ~ # change directory to home $ touch .profile #
I did a Windows 10 installation which I will show in class, with
AnonymousPro (a coding font that I like) GitBash (the mingw64 bash shell from GitHub) Anaconda python 2.7 (take the defaults during the install) Notepad++ (a good windows code editor) GnuEmacs25 (another code editor; what I'm used to) Firefox (what I'm used to)
I pinned to the task bar GitBash, an editor, and Firefox, set everything to display (Anonymous Pro 14), set my ~/.bashrc file to
# startup customizations # # workaround for a gitbash (mingw64) terminal bug alias python = "winpty python " # # always start in my home folder cd ~ # # customize the bash prompt export PS1="laptop:\W \u\$ "
and did the "touch" stuff described above. And we're off ...

chap 1 : overview of computers and terminology

The point here is to just make sure that we're all on the same page when it comes to what computers are and how they work.

computer & software overview

To understand what programming is and how it works, it's helpful to have good mental model of how the parts of computer systems function.
We have a book in the library that does a nice job with the ideas behind all this :
Code: The Hidden Language of Computer Hardware and Software
Let's walk through the basic concepts :
Other buzzwords :
Walk through what specifically happens when we "run" a "program" in python, and how that differs from other languages like C.
What do these buzzwords mean?

chap 1 : chaos

Just for fun, I've uploaded a jupyter (i.e. ipython) notebook showing the chaos example from chapter 1, adapted so that I can plot the numbers.
Near \( \alpha = 3.9 \) there is a "period doubling" route to chaos ...
See the attached files.

chap 2

software development cycle

variables

assignment

name = "Jim Mahoney" age = 57 data = [2.3, 3.2, 16.23]
The part on the RIGHT is evaluated first. Then that is put INTO the thing on the left.
Consider
x = x + 1
What is going on?

an example

Discuss the temperature_convert program.

debugging

Discuss ...

what's next

We're looking at chapters 2 & 3 this week.
The next assignment from those two chapters is posted - jump in and let me know how it's going.
http://cs.marlboro.edu/ courses/ fall2016/python/ notes/ Sep_6
last modified Monday September 5 2016 11:55 pm EDT

attachments [paper clip]

     name last modified size
[TXT]chaos_notebook.html Sep 5 2016 11:42 pm 234kB    chaos_notebook.ipynb Sep 5 2016 11:42 pm 43.2kB