Till KTH:s startsida Till KTH:s startsida

Lab 2

In these assignments you are expected to use Python and no additional libraries (except for standard libraries). The goal is to practice writing "pure" Python for those occasions when libraries or other good tools are not available for one reason or another.

Your code must be a Good Unix Citizen: your Python file itself is executable, files and arguments are read from the commandline (see below), and you use stdin, stdout, and stderr appropriately.

Basic assignments

These basic assignments are necessary to pass Lab 2.

  1. Download genomes
  2. Computing GC content
  3. Comparing base composition
  4. Compatibility

There are also an advanced assignment available, for the possibility to raise your grade.

Reading from the commandline

As an example of how to read from the commandline, consider creating a file called "reveal" with this contents

   #! /usr/bin/env python
   import sys
   print sys.argv

and then execute the command

   chmod +x reveal

to make it executable. Then, try you new program by running (for example)

   reveal a b c

How do you use this in this assignment?

Lars Arvestad skapade sidan 27 oktober 2016

En användare har tagit bort sin kommentar