Introduction to Python

  • 6,344 views
Uploaded on

Introduction to Python slides from the Vermont Code Camp 2010 gathering.

Introduction to Python slides from the Vermont Code Camp 2010 gathering.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
6,344
On Slideshare
0
From Embeds
0
Number of Embeds
5

Actions

Shares
Downloads
408
Comments
3
Likes
5

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Introduction to Python
    • A readable, dynamic, pleasant,
    • flexible, fast and powerful language
    Nowell Strite Manager of Tech Solutions @ PBS [email_address]
  • 2. Overview
    • Background
    • Syntax
    • Types / Operators / Control Flow
    • Functions
    • Classes
    • Tools
  • 3. What is Python
    • Multi-purpose (Web, GUI, Scripting, etc.)
    • Object Oriented
    • Interpreted
    • Strongly typed and Dynamically typed
    • Focus on readability and productivity
  • 4. Features
    • Batteries Included
    • Everything is an Object
    • Interactive Shell
    • Strong Introspection
    • Cross Platform
    • CPython, Jython, IronPython, PyPy
  • 5. Who Uses Python
    • Google
    • PBS
    • NASA
    • Library of Congress
    • the ONION
    • ...the list goes on...
  • 6. Releases
    • 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.0 adoption will take a few years
  • 7. Syntax
  • 8. Hello World hello_world.py
  • 9. Indentation
    • Most languages don’t care about indentation
    • Most humans do
    • We tend to group similar things together
  • 10. Indentation The else here actually belongs to the 2nd if statement
  • 11. Indentation The else here actually belongs to the 2nd if statement
  • 12. Indentation I knew a coder like this
  • 13. Indentation You should always be explicit
  • 14. Indentation Text Python embraces indentation
  • 15. Comments
  • 16. Types
  • 17. Strings
  • 18. Numbers
  • 19. Null
  • 20. Lists
  • 21. Lists
  • 22. Dictionaries
  • 23. Dictionary Methods
  • 24. Booleans
  • 25. Operators
  • 26. Arithmetic
  • 27. String Manipulation
  • 28. Logical Comparison
  • 29. Identity Comparison
  • 30. Arithmetic Comparison
  • 31. Control Flow
  • 32. Conditionals
  • 33. For Loop
  • 34. Expanded For Loop
  • 35. While Loop
  • 36. List Comprehensions
    • Useful for replacing simple for-loops.
  • 37. Functions
  • 38. Basic Function
  • 39. Function Arguments
  • 40. Arbitrary Arguments
  • 41. Fibonacci
  • 42. Fibonacci Generator
  • 43. Classes
  • 44. Class Declaration
  • 45. Class Attributes
    • Attributes assigned at class declaration should always be immutable
  • 46. Class Methods
  • 47. Class Instantiation & Attribute Access
  • 48. Class Inheritance
  • 49. Python’s Way
    • 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__
  • 50. Imports
    • Allows code isolation and re-use
    • Adds references to variables/classes/functions/etc. into current namespace
  • 51. Imports
  • 52. More Imports
  • 53. Error Handling
  • 54. Documentation
  • 55. Docstrings
  • 56. Tools
  • 57. Web Frameworks
    • Django
    • Flask
    • Pylons
    • TurboGears
    • Zope
    • Grok
  • 58. IDEs
    • Emacs
    • Vim
    • Komodo
    • PyCharm
    • Eclipse (PyDev)
  • 59. Package Management
  • 60. Resources
    • http://python.org /
    • http://diveintopython.org /
    • http://djangoproject.com /
  • 61. Example
  • 62. Going Further
    • Decorators
    • Context Managers
    • Lambda functions
    • Generators
    • ...
  • 63. Questions?
  • 64. Thanks!