Skip to Content
Bioinformatics Programming Using Python
book

Bioinformatics Programming Using Python

by Mitchell L Model
December 2009
Intermediate to advanced
521 pages
15h 26m
English
O'Reilly Media, Inc.
Content preview from Bioinformatics Programming Using Python

Chapter 6. Utilities

This chapter surveys many Python modules that are particularly important for bioinformatics programming. We will look at utilities that help you connect Python to its external environment, deal with filesystems, work with text, and debug your programs, among others. These aren’t particularly exciting, but it’s easy enough to learn how to use them. You’ll need some of them to deal with operating systems, filesystems, dates and times, and so on. Others will likewise prove extremely useful in the right circumstances, giving you ways to do in a few lines of code things that could take pages otherwise. Some of the modules aren’t necessary for simple scripts or initial development but provide the features users expect from mature programs.

System Environment

The first set of modules we’ll look at are those that allow Python to interact with its external environment. The categories included here are dates and times, command-line processing of various kinds, email, and logging.

Dates and Times: datetime

The datetime module defines classes that represent a date, a time, a combination of date and time, and a couple of others. There are some basic ways of manipulating instances of these classes, as well as some more elaborate ones that we won’t consider here.

Classes

The datetime module defines five classes. Their representations are simple, consisting only of several fields with primitive types. This allows them to define __repr__ methods that print exactly what you would enter ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Bioinformatics with Python Cookbook - Third Edition

Bioinformatics with Python Cookbook - Third Edition

Tiago Antao

Publisher Resources

ISBN: 9780596804725Supplemental ContentErrata Page