[Tutor] Simple string processing problem

cgw501@york.ac.uk cgw501 at york.ac.uk
Fri May 13 21:36:19 CEST 2005


Hi,

i am a Biology student taking some early steps with programming. I'm 
currently trying to write a Python script to do some simple processing of a 
gene sequence file.

A line in the file looks like:
SCER   ATCGATCGTAGCTAGCTATGCTCAGCTCGATCagctagtcgatagcgat

Ther are many lines like this. What I want to do is read the file and 
remove the trailing lowercase letters and create a new file containing the 
remaining information. I have some ideas of how to do this (using the 
isLower() method of the string module. I was hoping someone could help me 
with the file handling. I was thinking I'd us .readlines() to get a list of 
the lines, I'm not sure how to delete the right letters or write to a new 
file. Sorry if this is trivially easy.

Chris


More information about the Tutor mailing list