Processing text using python

Fredrik Lundh fredrik at pythonware.com
Mon Feb 20 11:46:02 EST 2006


"nuttydevil" <sjw28 at sussex.ac.uk> wrote:

> Hey everyone! I'm hoping someone will be able to help me, cause I
> haven't had success searching on the web so far... I have large chunks
> of text ( all in a long string) that are currently all in separate
> notebook files. I want to use python to read these strings of text,
> THREE CHARACTERS AT A TIME. (I'm studying the genetic code you see, so
> I need to read and analyse each sequence one codon at a time
> effectively.) Does anyone have any idea of how to do this using python?

did you read the string chapter in the tutorial ?

http://docs.python.org/tut/node5.html#SECTION005120000000000000000

around the middle of that chapter, there's a section on slicing:

    "substrings can be specified with the slice notation: two indices
    separated by a colon"

</F>






More information about the Python-list mailing list