Your SlideShare is downloading. ×
Intro to Python
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Intro to Python

2,354
views

Published on

Presentation about introductory Python delivered in front of CSSU.

Presentation about introductory Python delivered in front of CSSU.

Published in: Business, Technology

0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,354
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
198
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