Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Why Learn Python?

Why Learn Python?

Talk given at a PyLadies Intro to Python Workshop in 2011.

Christine Cheung

September 29, 2011
Tweet

More Decks by Christine Cheung

Other Decks in Technology

Transcript

  1. Programming How many of you have programmed before? What is

    the purpose? Make - create an app Break - edit an app Understand - how or why does it work?
  2. Okay cool, but why Python? Make - simple to get

    started Break - easy to read and edit code Understand - modular and abstracted
  3. Show me the Money IT Salaries are up Python is

    4th top growing skill in past 3 months Average starting Python programmer salary 70k+ Sources: - http://www.readwriteweb.com/enterprise/2011/05/it-hiring-and-salaries-up---wh.php - http://www.payscale.com/research/US/Skill=Python/Salary
  4. History + Facts Created by Guido van Rossum in late

    80s “Benevolent Dictator for Life” now at Google Fun and Playful Name is based off Monty Python Spam and Eggs!
  5. Strengths Easy for beginners ...but powerful enough for professionals Clean

    and elegant code whitespace enforcement Many modules and libraries to import from Cross platform - Windows, Mac, Linux Supportive, large, and helpful community
  6. C #include <stdio.h> int main(int argc, char*argv[]) { int a,b,c;

    scanf("%d",&a); scanf("%d",&b); c = a+b; printf("%d\n",c); } $ gcc -o add add.c $ ./add standard input/output return types scanf limitations compiling ...and not to mention memory allocation, pointers, variable types...
  7. Java import java.io.*; public class Addup { static public void

    main(String args[]) { InputStreamReader stdin = new InputStreamReader(System.in); BufferedReader console = new BufferedReader(stdin); int i1 = 0,i2 = 0; String s1,s2; try { s1 = console.readLine(); i1 = Integer.parseInt(s1); s2 = console.readLine(); i2 = Integer.parseInt(s2); } catch(IOException ioex) { System.out.println("Input error"); System.exit(1); } catch(NumberFormatException nfex) { System.out.println("\"" + nfex.getMessage() + "\" is not numeric"); System.exit(1); } System.out.println(i1 + " + " + i2 + " = " + (i1+i2)); System.exit(0); } } $ javac Addup.java $ java Addup classes, arguments input stream, buffer variable types try, catch, exceptions system.out compiling however, at least you don’t have to deal with garbage collection... :)
  8. Python a = input() b = input() c = a

    + b print c $ python add.py
  9. More Tech Talking Points Indentation enforces good programming style can

    read other’s code, and not obfuscated sub b{$n=99-@_-$_||No;"$n bottle"."s"x!!--$n." of beer"};$w=" on the wall"; die map{b."$w,\n".b.",\nTake one down, pass it around,\n".b (0)."$w.\n\n"}0..98 No more forgotten braces and semi-colons! (less debug time) Safe - dynamic run time type checking and bounds checking on arrays Source http://www.ariel.com.au/a/teaching-programming.html
  10. Scripting and what else? Application GUI Programming Gtk, Qt, Tk,

    WxWidgets, and MANY more... IronPython (.NET), Jython (Java) Web Frameworks Django, Pylons, TurboGears, Zope, ... Hardware Arduino interface, pySerial
  11. Is it really that perfect? Interpreted language slight overhead dynamic

    typing Complex systems (compute bound) Limited systems low level, limited memory on system