Python: A Simple Tutorial

[Pages:173]Python: A Simple Tutorial

Slides by Matt Huenerfauth

Python

? Python is an open source scripting language. ? Developed by Guido van Rossum in the early 1990s ? Named after Monty Python ? Available on lab computers ? Available for download from

Why Python?

? Very Object Oriented

? Python much less verbose than Java

? NLP Processing: Symbolic

? Python has built-in datatypes for strings, lists, and more.

? NLP Processing: Statistical

? Python has strong numeric processing capabilities: matrix operations, etc.

? Suitable for probability and machine learning code.

? NLTK: Natural Language Tool Kit

? Widely used for teaching NLP ? First developed for this course ? Implemented as a set of Python modules ? Provides adequate libraries for many NLP building blocks

? Google lNLTKz for more info, code, data sets, book..

The Power of NLTK & Good Libraries

Technical Issues

Installing & Running Python

The Python Interpreter

? Interactive interface to Python

% python Python 2.5 (r25:51908, May 25 2007, 16:14:04) [GCC 4.1.2 20061115 (prerelease) (SUSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>

? Python interpreter evaluates inputs:

>>> 3*(7+2) 27

The IDLE GUI Environment (Windows)

IDLE Development Environment

? Shell for interactive evaluation. ? Text editor with color-coding and smart indenting

for creating Python files. ? Menu commands for changing system settings

and running files.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download