• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
A Sip of Python
 

A Sip of Python

on

  • 688 views

An introductory session that given during the Cairo GTUG Meeting #4.

An introductory session that given during the Cairo GTUG Meeting #4.

Statistics

Views

Total Views
688
Views on SlideShare
682
Embed Views
6

Actions

Likes
0
Downloads
1
Comments
0

2 Embeds 6

http://www.linkedin.com 5
http://coderwall.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

    A Sip of Python A Sip of Python Presentation Transcript

    • A Sip of Python in 30 mins. Maher Gamal Ca i ro-GT U G
    • Development Cultures
      • SAFE
        • Follows the big companies
        • Must be widely approved
        • No chance for risks
      • EXPLORATORY
        • Tries out young technologies
        • Mostly self-motivated
        • Accepts calculated risks
    • How does Python look like ?
      • >>> print ( "Welcome everyone !" )
      • Welcome everyone !
      • >>> print ( "Welcome to %s !" % "GTUG" )
      • Welcome to GTUG !
      • >>> print ( "%s live in %s !" % ( "GTUG" , "Cairo" ))
      • GTUG live in Cairo !
      • # Enough with the print statements !
      • # What's next ? Modules !
    • How does Python look like ?
      • >>> import os
      • >>> os.listdir( "/home/maherg" )
      • ['Documents', 'Pictures', 'Workspaces']
      • >>> import sys
      • >>> sys.modules.keys()
      • [ ... 'os', 'time', 'subprocess', ... ]
      • # Can we write our own module ? Yes, we can !
    • How does Python look like ?
      • # gtug.py: GTUG's schedule
      • print ( "Welcome to GTUG's schedule !" )
      • sessions = [ 'Python' ,
      •              'AppEngine' ,
      •              'Hands-on Practice' ]
      • def list_sessions():
      •      """Prints the sessions for today"""
      •      print ( "Sessions List:" )
      •      for s in  sessions:
      •          print ( "- %s" % s)
    • How does Python look like ?
      • >>> os.listdir( "." )
      • ['gtug.py']
      • >>> import gtug
      • Welcome to GTUG's schedule !
      • >>> gtug.list_sessions()
      • Sessions List:
      • - Python
      • - AppEngine
      • - Hands-on Practice
    • How does Python look like ?
      • # gtug.py: GTUG's schedule
      • print ( "Welcome to GTUG's schedule !" )
      • sessions = { 'Python' : 'Maher Gamal' ,
      •              'AppEngine' : 'Amahdy Abdelaziz' ,
      •              'Hands-on Practice' : 'Everyone' }
      • def list_sessions():
      •      """Prints the sessions for today"""
      •      print (" Sessions List:" )
      •      for name, speaker in  sessions.items():
      •          print ( "- %s (%s)" % (name, speaker))
    • How does Python look like ?
      • >>> import gtug
      • Welcome to GTUG's schedule !
      • >>> gtug.list_sessions()
      • Sessions List:
      • - Python (Maher Gamal)
      • - AppEngine (Amahdy Abdelaziz)
      • - Hands-on Practice (Everyone)
      • >>> # What's next ? Packages !
    • How does Python look like ?
      • # gtug/__init__.py : GTUG's Package Indicator
      • print ( "Welcome to GTUG !" )
      • # gtug/schedule.py : GTUG's Schedule Module
      • >>> import gtug
      • Welcome to GTUG !
      • >>> import gtug.schedule
      • Welcome to GTUG's schedule !
      • >>> gtug.schedule.list_sessions()
    • How does Python look like ?
      • >>> from gtug import schedule
      • Welcome to GTUG !
      • Welcome to GTUG's schedule !
      • >>> schedule.list_sessions()
      • ...
      • >>> from gtug.schedule import list_sessions
      • >>> list_sessions()
      • ...
      • # What's next ? Classes !
    • How does Python look like ?
      • # gtug/classes.py : GTUG's classes
      • class Session():
      •      def __init__( self , title, status = 'none' ):
      •          self.title  = title
      •          self.status = status
      •      def start( self ):
      •          self.status = 'started'
      •     
      •      def stop( self ):
      •          self.status = 'stopped'
    • How does Python look like ?
      • >>> from gtug.classes import Session
      • >>> s = Session( 'A Sip of Python' )
      • >>> s.start()
      • ...
      • >>> s.stop()
      • >>> Session(status = 'pending' , title = '...' ).start()
    • Python's Edges
        • Allows multiple paradigms
        • Easily readable
        • Supports incremental development
        • Portable ( Runs on Win/Lin/Mac...etc.) 
        • Has loads of community-driven libraries
    • Python meets the Web
      • from google.appengine.ext import webapp
      • from webapp.util import run_wsgi_app
      • class MainPage(webapp.RequestHandler):
      •      def get( self ):
      •          self .response.out.write( 'Main Page' )
      • application = 
      •    webapp.WSGIApplication([( '/' , MainPage)])
      • run_wsgi_app(application)
    • Python Resources
    • Stay in Touch
        • linkedin : linkedin.com/in/mahergamal
        • blog     : maherg.blogspot.com
        • email    : mahergamal@gmail.com
        • mobile   : 011 351 585 1