This notebook was put together by [Jake Vanderplas](http://www.vanderplas.com) for UW's [Astro 599](http://www.astro.washington.edu/users/vanderplas/Astr599/) course. Source and license info is on [GitHub](https://github.com/jakevdp/2013_fall_ASTR599/).
Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python's simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed.
**Interpreted** | No need for a compiling stage |
**Object-oriented** | Objects: complex data structures with attributes and methods |
**High-level** | Abstraction from the way the machine actually executes |
**Dynamic** | Variables can change meaning on-the-fly |
**Built-in** | Fewer external requirements |
**Data structures** | Ways of storing/manipulating data |
**Script/Glue** | Code that controls other programs |
**Typing** | The kind of variable (int, string, float) |
**Syntax** | Grammar which defines the language |
**Library** | reusable collection of code |
"...in December 1989, I was looking for a 'hobby' programming project that would keep me occupied during the week around Christmas. My office ... would be closed, but I had a home computer, and not much else on my hands. I decided to write an interpreter for the new scripting language I had been thinking about lately: a descendant of ABC that would appeal to Unix/C hackers. I chose Python as a working title for the project, being in a slightly irreverent mood (and a big fan of Monty Python's Flying Circus)."
In [7]:
%pylab inline
N = 200
r = 2 * rand(N)
theta = 2 * pi * rand(N)
area = 200 * r ** 2 * rand(N)
ax = plt.subplot(111, polar=True)
scatter(theta, r, c=theta, s=area, alpha=0.75)
Out[7]:
In [11]:
from IPython.display import YouTubeVideo
YouTubeVideo('tlontoyWX70', start=30)
Out[11]:
In [22]:
!curl -O http://www.astroml.org/_downloads/fig_moving_objects_multicolor.py
%run fig_moving_objects_multicolor.py
The best option is one which includes code highlighting