Oct-12 - - | CS 35L SOFTWARE CONSTRUCTION LAB | | PYTHON...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
------------------------------------------------- | CS 35L SOFTWARE CONSTRUCTION LAB | | PYTHON COMMAND LINE TOOLS, MAKE, AUTOMAKE | | October 12, 2011 | ------------------------------------------------- === AGENDA ====================================== 1 Build a Command Line Tool Using Python 1.1 Command Line Tools Revisited 1.2 Optparse module in Python 1.3 Add your tool to PATH 2 Introduce Makefile 2.1 Why we need Makefile 2.2 An anotonomy to a basic Makefile 3 Introduce Autotools 4 Schedule of next lecture ================================================= ==== BUILD A COMMAND LINE TOOL USING PYTHON ===== ---- Command Line Tools Revisited --------------- -- What is a command line tool? -- A command line tool performs a task given input from command line environment and output the results after finishing the task. -- Pros and Cons -- + Modularity and reusability + Easy to automate + Easy to be envoked from different PLs - Low usability - Rely heavily on documentation - Cannot do too complicated jobs (MIMO) -- Philosophy -- * Do one thing well * Error handling on input / output * Make output adaptable to other tools -- Essentials of Command Line Tools -- * Command * Short Option * Long Option * Option argument * Arguments Example: make -f myMakeFile -s --ignore-errors\ --include-dir="/var/lib/abc" myprj -------------------------------------------------- ---- optparse Module in Python ------------------- -- optparse -- optparse module is used for parsing command-line options for command-line tools Documentation: http://docs.python.org/library/optparse.html
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

Oct-12 - - | CS 35L SOFTWARE CONSTRUCTION LAB | | PYTHON...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online