Tue sep 7
Questions about anything ?
nuts'n'bolots
- copyright and plagiarism
- go over how to submit your weekly work though this website
- tools: editors (textwrangler, notepad++, emacs, vim, ...) and compilers
brief discussion of computers and terminology
- memory / disk / cache
- source code
- compiler
- process
- operating system
command line vs GUI
Mac/Unix:
# Mac: The application is /Applications/Utilities/Terminal
# Unix: depends; look for "Terminal" in application menu
$ cd /folder/name # change directory
$ ls # list directory
$ pwd # print working directory
$ python file.py # run python program in file.py
Windows
# XP: Start ... Programs ... Accessories ... Command Prompt
> cd \folder\name # change directory
> dir # list directory
> cd # show current directory
> python file.py # run python program in file.py
running python
- interactively
- lab mac, "Terminal" program in Applications/Utilities; type "python"
- or could be remotely on cs ; "ssh" to your_username@cs.marlboro.edu (after I give you an account) and then type 'python' (no quotes)
- demo
- chaos program
- type it in, save to a folder, run it.
- source
random
chap 2 topics
... if we get that far
- First: have a plan
- comments
- variables
- variable names
- assignment statements : "x = 5" ; "x = x + 1"
- range(n) : a list of things
- "for" loops
- python "gotcha's" (every language has it's quirks) :
- input("prompt") # do use ()
- print "stuff" # don't use ()
- other functions :