Intro to
Programming
(with Python)

Fall 2015
course
navigation

Tue Sep 9

short programs with variables, loops, input/output, and all that

First : questions about anything so far?
OK, moving on. We're looking at chaps 1 - 3 next, so please read them. The notes here talk about getting your software and workflow in place, and then looking at coding. (These notes will likely be more than we can do on Tuesday, and if so we'll continue Thursday.)

editing, command line, python

Discuss where you are at the practical bits :
I will run on Windows today, to show the recommended workflow there. (You'll have to excuse my Microsoft-ineptness at time, probably.)
The software I recommend installing for Windows is
When I did this on Windows7 running under Parallels on my mac air on Sep 7 2015, installing GitBash first and then Anaconda, the path was modified appropriate automatically and it all "just worked". Your mileage may vary.
If you hit problems, ask for help - there are many variations of systems and hardware issues that might get in the way.
Once everything is installed, my workflow is
On a mac or unix machine, typically python and bash (called "Terminal" on a mac) are already installed.

command line $PATH (unix) or %path% (windows)

One "gotcha" with using a command line is that even if the software is installed somewhere on your system the command line "shell" may not be able to find it. So there are two things you need to find and connect: the python program, and the hello.py file you've created with the editor.
The command line settings are stored in "environment variables". One of these, called "path", holds a list of folders to look in for the program names that you type at the prompt
# Mac Terminal (bash shell) $ echo $PATH ... # Windows command prompt > echo %path% ...
The python program needs to be in that list, or you won't be able to run it from the command prompt. This is sometimes an issue when getting (say) GitBash to find the Anaconda python.
This site gives a recipe for setting the path for python.org's python, so that GitBash can find it.

Feedback?

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.

coming next

This week: chapter 2 & 3 in the text :
The next assignment from those two chapters is posted - jump in and let me know how it's going.

chap 2

software development cycle
Discuss the temperature_convert program.
... and we'll pick this up on Thursday.
http://cs.marlboro.edu/ courses/ fall2015/python/ notes/ Sep_8
last modified Tuesday September 8 2015 2:27 pm EDT