Python training material
This page contains exercises of the BITS training session "Gentle hands-on introduction to python programming" and material of the Biopython training.
Contents
Python
Python is a powerful programming/scripting language that is easy to use, and it's free! It has been around for a while and has gone through many versions; for this course we will be using Python version 2.7. This is not the latest version, but probably the most common at the moment. Note that it is important to know which version you are using, as there are differences between them - something that works in version 2.7 might crash when you use another version.
Training outline
Python is a programming language - like any language you have to learn the basics before you can start to do more interesting things. This course introduces the syntax and main concepts in Python programming, and should get you set up to learn more yourself. Also see the course announcement for an overview.
Slides
Python training
Biopython training
- Material for day 1
- Material for day 2
- Solutions and example code
- Tutorial for exercises
- Biopython documentation
- Git free distributed version control system
- pyenv software to maintain multiple Python versions on your computer
- Simple Python exercises online
- More advanced Python exercises online
- Bioinformatics exercises online
- Matplotlib gallery
- Seaborn gallery
Exercises
Note: these pages are being updated to Python version 3.6 from version 2.7. Some code might have been overlooked, so let me know if you find any problems
Day 1
- Using Python on Windows: How to run your programs
- Python training exercise 0: Show me something!
- Python training exercise 1: Variables and operators; or how to assign x and y and do something with them
- Python training exercise 2: Print formatting; or show me something in a nicer way
- Python training exercise 3: Conditions; decide what to do based on x and y
- Python training exercise 4: Lists, tuples and sets; grouping x and y
- Python training exercise 5: Loops; do the same thing over and over again
- Python homework: Practice makes perfect
Day 2
- Python day 1 recap: Revisit of material of day 1
- Python training exercise 6: Dictionaries; set relation between x and y
- Python training exercise 7: Files; read and write
- Python training exercise 8: Functions; re-use the same bit of code
- Python training exercise 9: Imports; using existing code
- Python training exercise 10: Assert and try/except; check, check, check
- Python training exercise 11: Classes; combine building blocks
References, Sources, ...
Author
Wim Vranken