Scripting with Bash and Python - 2011
Overview
The compact course on scripting in Bash and Python will take place from
- May 2-13, 9:30-13:30 (including breaks).
We will have 4 days of Bash, and 5 days of Python. In the first week, there will be no course on Thursday.
The course consists of lecturing parts (roughly 9:30-11:30) and tutorials to (roughly 11:30-13:30) allow you to practice what you've learned. If you have any questions, don't hesitate to contact me.
In the following, you can find the course materials and additional information:
Announcements
- There will be no course on Thursday, May 5!
- We will start Python on Monday in the second week.
Requirements
As the course is rather interactive, please bring your laptop (preferably with Linux). You can then just try things out and practice right away.
For Bash
- Bash as shell (*1)
- Collection of standard tools
- gnuplot
- If you are using Windows, we recommend to install cygwin full/extended
For Python
- Python 2.6, as not all packages have been ported to Python 3.X (*1)
- Packages:
- Scipy (which should include IPython as interactive Python shell; if not, get IPython); see [1]
- PyLab/Matplotlib
- Gnuplot
(*1): Required for the first day each.
Slides
- The slides for Monday, May 2, Bash Day 1
- The slides for Tuesday, May 3, Bash Day 2
- The slides for Wednesday, May 4, Bash Day 3
- The slides for Friday, May 6, Bash Day 4
- The slides for Monday, May 9, Python Day 1
- The slides for Tuesday, May 10, Python Day 2
- The slides for Wednesday, May 11, Python Day 3
- The slides for Thursday, May 12, Python Day 4
- The slides for Friday, May 13, Python Day 5
Tutorials
- Monday, May 2, Galton Board
- sample solutions: [galtonboard.sh]
- Tuesday, May 3, File Renamer and Address Manager
- sample solutions:[file_renamer.sh][addresses.sh]
- Wednesday, May 4, Chocolate Competition; see slides for solutions
- Friday, May 6, Simulation runtime results
- Monday, May 9, TicTacToe
- tictactoe.py: program frame
- sample solutions: [tictactoe_solution.py]
- Tuesday, May 10, Caesar's Cipher (with Chocolate Option)
- Two texts, plaintext.txt, encryptedtext.txt
- Guido's nice solution
- Example scripts from us:
- Wednesday, May 11, Blackjack (LAST Chocolate!)
- blackjack.py: program frame
- sample solution: [blackjack_solution.py] (including player of Chengran)
- Thursday, May 12, Practicing Modules & Co.
- Friday, May 13, Advanced File Renamer in Python
- renamer.py: sample solution; note that almost all the code is dedicated to help and comments; the real functionality is rather short.
Other Files
- story.tgz: Sample folder and sample text files
- MCMC.tgz: MCMC files
- sed_example.txt: well commented step-by-step instruction for a sed replacement task
- runtimes.tgz: molecular dynamics runtime results
- Few files: fulltext.txt, matrix.txt, matrix.dat
- Hangman - really nice hangman program written by XX