Hi I am VERY new to python. I am trying to write a function that returns lines from a text file to a new file. I can't seem to get it right. So far my code looks like this:
def seperate_atoms(f):#Enter .pdb file in with quotations
myfile=open(f,'r')
crudepdb=myfile.readlines()
cleanpdb=[]
for line in crudepdb:
templine=line.strip()
cleanpdb.append(templine)
for x in cleanpdb:
if x[0:4]=="ATOM":
x=("myfile","w")
print>>x
Does anyone know what I'm doing wrong?