Guest User

orcepromo

a guest
Jan 2nd, 2010
519
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.92 KB | None | 0 0
  1. import urllib2
  2. import string
  3. sv=ba=en=eg=ar=ti=0
  4. for i in open("codigos.txt","r").readlines():
  5.     s="http://www.orce.uni.edu.pe/detaalu.php?id="+i[:-1]+"&op=detalu"
  6.     r=urllib2.urlopen(s)
  7.     h=r.read()
  8.     no=string.rstrip(" ".join(h.split('Nombres')[1][0:104].split("<td>")[1].split("</td>")[0].split("-"))).title()
  9.     si=h.split('Situaci')[1][0:54].split("<td>")[1].split("</td>")[0]
  10.     print "+ "+i[:-1] +" "+no+" -> " +si
  11.     if si=='SUSPENSION VOLUNTARIA':
  12.         sv=sv+1    
  13.     elif si=='BACHILLER':
  14.         ba=ba+1
  15.     elif si=='EN REGULARIZACION DE CURSO(':
  16.         en=en+1
  17.     elif si=='EGRESADO':
  18.         eg=eg+1
  19.     elif si=='TITULADO':
  20.         ti=ti+1
  21.     else:
  22.         ar=ar+1
  23.  
  24. print "+ TITULADOS : "+ str(ti)+ "\n+ BACHILLER : "+ str(ba)+ "\n+ EGRESADO : "+ str(eg) +"\n+ SUSPENSION VOLUNTARIA : "+ str(sv)+"\n+ EN REGULARIZACION DE CURSO : "+ str(en)+" \n+ ALUMNOS REGULARES : "+ str(ar)
  25.  
  26.  
  27.    
  28.  
Advertisement
Add Comment
Please, Sign In to add comment