{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "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/)." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Welcome to the Python Boot Camp!!\n", "=================================\n", "\n", "\n", "\n", "Much of this material thanks to http://www.pythonbootcamp.info/\n", "" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Objectives\n", "----------\n", "- Introduce you to the Python language\n", "- Get you *writing* Python code.\n", "- Convince you of Python's utility in your research life\n", "- Encourage good coding and data-management practices\n", "- Don't proselytize Python... too much" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Organization\n", "------------\n", "- Thursday-Friday, 9:00-12:00 & 1:00-4:00\n", "- Broken into 1-hour \"modules\"\n", "- Short breakout coding sessions after each module\n", "- Actual coding $\\to$ actual learning" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Course Information\n", "------------------\n", "\n", "- Course website: [http://www.astro.washington.edu/vanderplas/Astr599](http://www.astro.washington.edu/vanderplas/Astr599)\n", "- Github source: [http://github.com/jakevdp/2013_fall_ASTR599/](http://github.com/jakevdp/2013_fall_ASTR599/)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Connecting to Me\n", "----------------\n", "### Jake Vanderplas\n", "\n", "- Email: jakevdp@cs.washington.edu\n", "- Twitter: [@jakevdp](http://www.twitter.com/jakevdp)\n", "- Github: [jakevdp](http://github.com/jakevdp)\n", "- Web: [http://www.astro.washington.edu/vanderplas](http://www.astro.washington.edu/vanderplas)\n", "- Blog: [http://jakevdp.github.io](http://jakevdp.github.io)\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "\n", "\n", "### 1. What is Python?\n", "\n", "### 2. Why should a scientist use Python?\n", "\n", "### 3. Getting started: four ways to use Python" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## What is Python?\n", "\n", "> 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.\n", "\n", "
**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).\"
\n", "\n", "