Answer to Question #17141 in Python for eleiloon

Question #17141
Hi,
I have wrote a script to create a table includes TITLE, AUTHOR and DATE of PUBLISH from pdb.org website, but it doesn't work, could you please help me?
#! /usr/bin/env python
import urllib
IDListURL = "http://www.pdb.org/pdb/results/ids.jsp?qrid=4A451CD"
IDList = urllib.urlopen(IDListURL)
for Line in IDList:
CODE = Line.strip()
PDBUrl = "http://www.pdb.org/pdb/files/%s.pdb" % (CODE)
PDBFile = urllib.urlopen(PDBUrl)
FileName = "pdb.test%s.pdb" % (CODE)
OutPDB = open(FileName, 'w')
for Line in PDBFile:
ThisLine = Line.strip()
OutPDB.write(ThisLine+"\n")
OutTableFile = "Result.table.txt"
OutTable = open(OutTableFile, 'w')
Table = []
for Line in IDList:
CODE = Line.strip()
FileName = "pdb.test%s.pdb" % (CODE)
ReadPDB = open(FileName, 'r')
# Search 1:
for Line in ReadPDB:
if "TITLE" in Line:
SE1 = Line.strip()
break
# Search 2:
for Line in ReadPDB:
if "^Author" in Line:
SE2 = Line.strip()
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS