Python 3 Intro Presentation for NEWLUG
Upcoming SlideShare
Loading in...5

Python 3 Intro Presentation for NEWLUG



An introduction to programming in Python 3, aimed at people who are new to programming.

An introduction to programming in Python 3, aimed at people who are new to programming.



Total Views
Views on SlideShare
Embed Views



2 Embeds 13 12 1



Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Python 3 Intro Presentation for NEWLUG Python 3 Intro Presentation for NEWLUG Presentation Transcript

  • Python 3 for n00bs
      NEWLUG Presentation: June 17th, 2010 Presented by: Ross Larson
    • Software Developer, Cooperative Resources International
  • So, What is Python, anyways?
    • Named in honor of Monty Python
    • Created in the late 80's by Guido van Rossum View slide
    • Designed to be fun to use, as well as flexible.
    View slide
  • Python, a Brief version history
    • Conceived in the late 80's, implementation started in December 1989
    • Version 2.0 – October 16th, 2000
      • Development shifts to a more transparent, community-backed process
    • Version 3.0 – December 3rd, 2008
      • Backwards incompatible with previous versions
      • Some developers still choose to use Python 2.6
  • So, why use Python?
    • Lots of Stuff Uses it!
      • Django
      • PyGame
      • Google App Engine
      • Quickly
      • PyQt
      • PyGtk
      • Zope
      • And....more!
  • OK! Great! I'm in! Now what?
    • To install Python 3 in Ubuntu, search for ”python3” and install it via synaptic.
    • Development can be done either in a text editor like gedit, vim, or gvim
    • Integrated Development Environments (IDEs) are available, as well (IDLE, PyDev for Eclipse).
    • I wrote a PyDev install HOWTO on my blog:
  • Uh, I'm lost! Is there any documentation?
    • Plenty!
      • Python website ( )
      • Dive into Python ( )
      • Koders Code Search ( )
      • YouTube tutorials
      • Google
      • IRC channels
  • The Zen of Python - by Tim Peters
    • Beautiful is better than ugly.
    • Explicit is better than implicit.
    • Simple is better than complex.
    • Complex is better than complicated.
    • Flat is better than nested.
    • Sparse is better than dense.
    • Readability counts.
  • Zen of Python, Part 2
    • Special cases aren't special enough to break the rules.
    • Although practicality beats purity.
    • Errors should never pass silently.
    • Unless explicitly silenced.
    • In the face of ambiguity, refuse the temptation to guess.
  • Zen of Python, Part 3
    • There should be one-- and preferably only one --obvious way to do it.
    • Although that way may not be obvious at first unless you're Dutch.
    • Now is better than never.
    • Although never is often better than right now.
    • If the implementation is hard to explain, it's a bad idea.
    • If the implementation is easy to explain, it may be a good idea.
    • Namespaces are one honking great idea -- let's do more of those!
  • OK, Let's open up Python3
    • To open the Python 3 Interpreter, type ”python3” at the command line.
    • woo@beast:~$ python3
    • Python 3.1.2 (r312:79147, Apr 15 2010, 15:35:48)
    • [GCC 4.4.3] on linux2
    • Type "help", "copyright", "credits" or "license" for more information.
    • >>>
  • Now, Let's write a simple program!
      >>> print("Hello NEWLUG!") Hello NEWLUG!
  • OK, I'm still with you.
    • How about variables?
    • >>> newlug = "San Dimas High School Football Rules!"
    • >>> print(newlug)
    • San Dimas High School Football Rules!
  • OK, fine. But what if I don't want to type everything when I run it?
    • Open a new empty file.
    • Name it ””
    • Insert:
    • print("Hello NEWLUG!")
    • Save and Close the file.
  • OK. Fine. Whatever.
    • From the command line, type:
      • python3
  • Wow, now I'm a programmer!
      Well, kind of. There is quite a bit more to learn.
    • Everything is an Object!
    • Data types (String, Boolean, Tuple, Dictionary, etc)
    • Functions
    • Arguments
    • User Input
    • Exception Handling and Redirection
    • Loops
  • Soon, this will make sense:
  • Watch out for....
    • Indentation and Spacing
      • Never use combinations of tabs and spaces!
      • ”If you use both tabs and spaces in a Python program, that makes you a bad person” - Brian Blazer
    • Different Versions of Python
      • The default ”python” is often Python 2.6!
      • Python scripts can be converted to Python 3
    • The ”loosey-goosey” nature of Python
      • Python gives you enough rope to hang yourself.
  • ...And now for something completely different
  • Questions?