Upload
al-sayed-gamal
View
141
Download
1
Embed Size (px)
Citation preview
Python 45s #4Weekly hangout by @AlSayed gamal
�1
Last HangoutsLanguage Basic Syntax.
Branching and Loops.
Functions.
Data Structures.
Exceptions.
Modules.
I/O and Files.
�2
This hangout
Command Line Arguments
Advanced Iteration.
Debugging.
Next on Python45s
�3
CLI Options
From optparse import OptionParser
Short and long options.
actions and store actions
parser.print_help()
CLI Options (2)
option_list = [ make_option("-f", “--filename", action="store", type="string", dest=“filename”),..]
parser = OptionParser(option_list=option_list)
Advanced Iteration
List comprehension
Generator Expression
Generator Functions
Item0Item1
Item2
next()
next()next()
Item3
Item2
next()next()
Item3
Item ?
next()
–Edsger Dijkstra*
“If debugging is the process of removing software bugs, then programming must be
the process of putting them in.”
* http://en.wikipedia.org/wiki/Edsger_W._Dijkstra
Debugging
Find the bug first.
pdb
pdb.set_trace()
Next on 45sAs if you are watching MBC Action :)
Thank youDon’t forget to post your question if any