location_regain_by_time.py 454 B

1234567891011121314
  1. #!usr/bin/python
  2. import sys
  3. current_loc="START_OF_APP"
  4. govt_regains=[]
  5. for line in sys.stdin:
  6. (loc,event_date,event_type)=line.strip("\n").split("\t");
  7. if loc!=current_loc :
  8. if current_loc!="START_OF_APP":
  9. print(current_loc+"\t"+"\t".join(govt_regains))
  10. current_loc=loc
  11. govt_regains=[]
  12. if event_type.find("regains")!=1:
  13. govt_regains.append(event_date)D:\app\NBA\src\test\location_regain_by_time.py