• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Intro to Python
 

Intro to Python

on

  • 3,295 views

Presentation about introductory Python delivered in front of CSSU.

Presentation about introductory Python delivered in front of CSSU.

Statistics

Views

Total Views
3,295
Views on SlideShare
3,254
Embed Views
41

Actions

Likes
6
Downloads
190
Comments
0

5 Embeds 41

http://helloworld.atihow.com 30
http://hdknr.posterous.com 6
http://www.slideshare.net 3
http://www.soup.io 1
http://posterous.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

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.

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

    Intro to Python Intro to Python Presentation Transcript

    • Intro to Python CSSU Nov/28/2007 By Georgi Petrov & Atanas Dyulgerov
    • Outline
      • What is Python
      • Python Advantages
      • Who uses Python
      • Syntax & Semantics
      • Data Structures
      • Python Standard Library
      • Demo 1
      • Object Orientation
      • Demo 2
    • What is Python?
      • interpreted, interactive, object-oriented programming language
      • Widely used in the industry
      • Cousin of Tcl, Perl and VB
      • Used in web programming and in standalone applications
    • Python Advantages
      • Elegant syntax
      • Safe
      • Object-oriented
      • Powerful
      • Portable
      • Free
    • Python is simple print &quot;Hello World!&quot; #include <iostream.h> int main() { cout << &quot;Hello World!&quot;; }
      • public class helloWorld
      • {
        • public static void main(String [] args)
        • {
        • System.out.println(&quot;Hello World!&quot;);
        • }
      • }
      Python C++ Java
    • Python is fun & practical
      • Lack of type declaration
      • Huge library of modules
      • Widespread use in industry
      • Available for all the major platforms (Windows, MacOS, Linux, Unix, BeOS, Java)
    • Who uses Python
      • Google
      • NASA
      • Rackspace
      • Industrial Light & Magic
    • Syntax - Indentation
    • Syntax - Operators
      • Comparison Operators ==, <, >, <=, >=
      • Logical Operators Zero values are treated as “”, 0, None, 0.0, [] and {}
    • Data Structures
      • Base Types integer, float, long integer, octal integer, hexadecimal integer, complex, character string, list, dictionary, tuples, file
      • Collection types
      • sequences & mappings
      • Object system
    • Python Standard Library
      • The greatest strengths of Python
      • Hundreds of modules
      • Examples
      • Syntax: import email
      email , math , calendar , HTMLParser
    • Object Oriented Mechanism
      • Similar to C++ and Java
      • Supports multiple inheritance
      • Polymorphism
      • No private class members 
      class Stack: def __init__(self,size): self.data = [None]*size self.size = 0   def push(self,item): self.data[self.size] = item self.size = self.size + 1   def pop(self): self.size = self.size - 1 return self.data[self.size]   def is_empty(self): return self.size == 0   def is_full(self): return self.size == len(self.data)
    • Demo 1
      • Adjusting Apache to read Python
      • Sample “Hello World” script
    • Object Orientation
      • Defining classes
        • class SomeClass:
        • &quot;Just some class...that's all.&quot;
      • Adding data members and methods
        • class SomeClass
        • &quot;Just some class...that's all.&quot;
        • someNumber = 2131
        • def someFunction ( self ):
        • return someNumber
    • Object Orientation
      • Self
      • Instantiating
        • myObject = myClass() ‏
      • Calling and addressing
        • myObject.someFunction() ‏
      • Deletion
        • del myObject.someNumber
    • Object Orientation
      • Constructors
        • class AnotherClass:
        • def __init__ ( self, anotherArgument ):
        • self.anotherArgument = anotherArgument
      • Single/Multiple Inheritance and Overriding
        • class ParentClass:
        • def print( self ):
        • print “parent”
        • class ChildClass ( ParentClass ):
        • def print( self ):
        • print “child”
    • Demo 2
      • Brief networking info
      • Sockets
      • SocketServer Framework
      • Ports and Addresses
      • Demo
    • References
      • http://wiki.python.org
      • http://www.python.org/
      • http://en.wikipedia.org/wiki/Python_(programming_language)
    • Thank You
      • Q & A