Download Introduction to Python

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript


A readable, dynamic, pleasant,
flexible, fast and powerful language
Introduction to Python






Background
Syntax
Types / Operators / Control Flow
Functions
Classes
Tools
Overview





Multi-purpose (Web, GUI, Scripting, etc.)
Object Oriented
Interpreted
Strongly typed and Dynamically typed
Focus on readability and productivity
What is Python





Google
NASA
Library of Congress
the ONION
And many other companies
Who Uses Python






Created in 1989 by Guido Van Rossum
Python 1.0 released in 1994
Python 2.0 released in 2000
Python 3.0 released in 2008
Python 2.7 is the recommended version
3.4 is used nowadays
Releases
Syntax
hello_world.py
Hello World
Comments
Types
Strings
Numbers
Null
Lists
Lists
Booleans
Operators
Arithmetic
String Manipulation
Logical Comparison
Identity Comparison
Arithmetic Comparison
Control Flow
Conditionals
For Loop
Expanded For Loop
While Loop

Useful for replacing simple for-loops.
List Comprehensions
Functions
Basic Function
Function Arguments
Arbitrary Arguments
Fibonacci
Fibonacci Generator
Classes
Class Declaration

Attributes assigned at class declaration should always
be immutable
Class Attributes
Class Methods
Class Instantiation &
Attribute Access
Class Inheritance
No interfaces
 No real private attributes/functions
 Private attributes start (but do not end) with
double underscores.
 Special class methods start and end with double
underscores.


__init__, __doc__, __cmp__, __str__
Python’s Way
Imports
More Imports
Error Handling
Tools






Django
Flask
Pylons
TurboGears
Zope
Grok
Web Frameworks





IDEs
Emacs
Vim
Komodo
PyCharm
Eclipse (PyDev)



http://python.org/
http://diveintopython.org/
http://djangoproject.com/
Resources
The End
Related documents