Guest User

Untitled

a guest
Nov 21st, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. from urllib.request import urlopen
  2.  
  3. id = "P42212"
  4. data = urlopen("http://www.uniprot.org/uniprot/" + id + ".txt").read().decode()
  5. result = data.split('SQ ')[-1] #here all the info you need
  6. mw = int(result.split(';')[1].strip().split()[0]) #extract the molecular weigth
  7. print(mw)
Add Comment
Please, Sign In to add comment