Python Programming

This course has been superseded

We suggest the following instead:
Python programming - Introduction

Course Description

On this course students will learn the design philosophy and strengths of Python and run-time features assisting rapid development. You will be able to programme using loops, lists, variables and dictionaries. You will be able to use operators such as `and`, `in`, %, == and `is`. You will also be able to read and write data to files and use the % operator for string-formatting, be able to use existing Python modules and create new ones, use exceptions for error-handling and create Object-Oriented Python using the `class` keyword.
3 Days
Contact us for pricing
 

Prerequisites

Participants should be familiar with basic programming constructs such as variable assignment, conditions, loops and I/O. Programming experience in a procedural language such as C or Pascal, or an OO Language such as Java, C++. The more practical coding experience the better.

Language Fundamentals

Command-Line Interpreter
Integer, Float, String
Basic operations (=, +, *, -, /, %)
Type conversations
Equality

Python Scripting

Running a Python script
Providing command-line arguments
Syntax and indentation
List operations: creating, slicing, iterating
Range operation
String operations

Modules and Functions

Running a main routine in module
Calling a function from main
Calling a function from another module
Local and global variables, pass-by-value to function
Comments (#)
Different forms of import
PYTHONPATH
Calling functions with default arguments

Flow of Control

For and While loops
Conditionals (if)
Exception handling

Advanced Data Objects

Creating and using tuple data objects
Creating and using dictionary data objects
References and copies (id, copy)
Type
Built-in operators (dir)

Input/Output

Reading from and writing to console (%)
Reading from and writing to file
The String Module
Module documentation (pydoc)

Useful Modules

Randomization whrandom
Time/Date time
os, os.path
Mathematics math
thread
glob
unittest
StringIO

Object-Oriented Python

Classes and objects
Overriding built-in methods
Inheritance and polymorphism

Advanced Parsing

Regular Expressions (re)

Useful Idioms and Shortcuts

map
lambda
reduce
type conversations

PythonPython Programming