Python Intro

 

Links

A guide to some basic features

Python container types

Index

Python Wiki

Tutorial

Editors

IDEs

A basic syntactic distinction
* Statements and Expressions
Some basic data types
* Lists , Splicing example
* Strings
* tuples
* Dictionaries
Python supertypes
* Mutable types
* Containers
Look and feel
* Indentation expresses program block structure (An example, Discussion)
* Editors and Integrated Development Environments (IDEs)
IDLE (packaged with Python)
PythonWin
Komodo
Wing
SPE
PyDev/Eclipse
IDEStudio
IPython

 

Why Python?

 :
* Stable
* Portable across many platforms and OSs
* Mature
* Lots of applications of different types
* Many platforms
* Portability claims tested
* Good for rapid prototyping
* Good for beginners
* Debugging facilities
* Extensions
C, C++ (SWIG, SIP, PYCXX)
Fortran (F2Py)
Java (Jython)

Classifying Python

* Interpreted (comes with a compiler AND interpreter)
* Polymorphic
* High-level (VHLL?)
No user burden of memory management
Undeclared variables OK (Dynamic typing)
Fewer Errors caught at compile time, more at run time
* Excellent run time error handling (a strong point!) [It's hard to crash Python!]
* Spare (but not minimalist)
Often one (best) way to say it! (Contra Perl!)
* Object-oriented
Python classes and instances
* Object-oriented programming is optional!
You can program in Python without thinking about classes
* Competitors
Perl
Ruby
TCL (not as versatile as the others ?)

Some useful Python idioms and/or tools

* Opening, reading, and writing to files
Comment
* List comprehension
Very Pythonic idiom!
* Zipping!
* Regular expressions
Comment on item 2
* Standard Unix scripting tools
* Local and global variables in Python
When a variable is set in a function, it becomes local!
* A summary example
* Python pitfalls
* Python gotchas
* Python efficiency guide