Intro to Python

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Intro to Python - Presentation Transcript

    1. Intro to Python CSSU Nov/28/2007 By Georgi Petrov & Atanas Dyulgerov
    2. Outline
      • What is Python
      • Python Advantages
      • Who uses Python
      • Syntax & Semantics
      • Data Structures
      • Python Standard Library
      • Demo 1
      • Object Orientation
      • Demo 2
    3. 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
    4. Python Advantages
      • Elegant syntax
      • Safe
      • Object-oriented
      • Powerful
      • Portable
      • Free
    5. 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
    6. 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)
    7. Who uses Python
      • Google
      • NASA
      • Rackspace
      • Industrial Light & Magic
    8. Syntax - Indentation
    9. Syntax - Operators
      • Comparison Operators ==, <, >, <=, >=
      • Logical Operators Zero values are treated as “”, 0, None, 0.0, [] and {}
    10. 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
    11. Python Standard Library
      • The greatest strengths of Python
      • Hundreds of modules
      • Examples
      • Syntax: import email
      email , math , calendar , HTMLParser
    12. 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)
    13. Demo 1
      • Adjusting Apache to read Python
      • Sample “Hello World” script
    14. 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
    15. Object Orientation
      • Self
      • Instantiating
        • myObject = myClass() ‏
      • Calling and addressing
        • myObject.someFunction() ‏
      • Deletion
        • del myObject.someNumber
    16. 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”
    17. Demo 2
      • Brief networking info
      • Sockets
      • SocketServer Framework
      • Ports and Addresses
      • Demo
    18. References
      • http://wiki.python.org
      • http://www.python.org/
      • http://en.wikipedia.org/wiki/Python_(programming_language)
    19. Thank You
      • Q & A

    + petrovpetrov, 3 years ago

    custom

    799 views, 0 favs, 0 embeds more stats

    Presentation about introductory Python delivered in more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 799
      • 799 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 59
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories