资讯专栏INFORMATION COLUMN

Bioinformatics Programming Using Python

iflove / 462人阅读

Bioinformatics Programming Using Python Chapter 6

Working with Text: textwrap

# Returns a copy of the string text with whitespace common to all of its lines re- moved
textwrap.dedent(text)

## useful in dealing with FASTA files
# break up seq to a list of 80-line strings 
textwrap.wrap(seq, 80)

# insert newlines every 80 characters
textwrap.fill(seq, 80)

Persistent Storage

The dbm module provides an interface to the Unix “(n)dbm” library. Dbm objects behave like mappings (dictionaries), except that keys and values are always strings.

"r" Open existing database for reading only (default)

"w" Open existing database for reading and writing

"c" Open database for reading and writing, creating it if it doesn’t exist

"n" Always create a new, empty database, open for reading and writing

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/37538.html

相关文章

发表评论

0条评论

iflove

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<