PythonBasics

From CASA Guides
Revision as of 01:28, 10 October 2011 by Aleroy (talk | contribs)
Jump to navigationJump to search

Simple Variables

Basic Math

Ints and Floats

Booleans

Deleting Variables

Checking Whether a Variable Exists

Data Collections: Lists

Lists are one of the fundamental data collections in python (we will also discuss dictionaries and you may want to read about tuples and sets).

Data Collections: Dictionaries

Dictionaries are another basic python data collection. Dictionaries store data in pairs, with a set of unique keys each mapped to some value (the values do not have to be unique). Dictionaries are extremely useful in scripting. For example, imagine that we are reducing a complex set of observations and want to be able to look up a the calibrator associated with a given source.

Control Flow

If

While

For

Break/Continue

More Complex Programs

Executing Scripts

Functions

Modules

Object Oriented Aspects

Tips and Tricks

Pasting Code

Getting Help, Exploring Objects

Things That Work Only in the Shell