Intro to Python

  • 2,318 views
Uploaded on

Presentation about introductory Python delivered in front of CSSU.

Presentation about introductory Python delivered in front of CSSU.

More in: Business , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,318
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
195
Comments
0
Likes
6

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. 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