Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Copy/Paste your staff= into this string here:
- server_staff = "Monkeybob,BlueMelon,Crow,Stefan"
- months = ['Jan','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
- log = open("rclog.txt",'r').readlines()
- staff = server_staff.split(",")
- times = {}
- for s in staff:
- times[s] = 'Jan 01'
- for i in range(0,len(log)):
- if (i+1) >= len(log):
- break
- line = log[i]
- line2 = log[i+1]
- if "is logged in from" in line2 and "Client-RC" not in line2:
- acc = line2.split(" ")[0]
- if acc in staff:
- currentmonth = times[acc].split(" ")[0]
- currentmonth_num = months.index(currentmonth)
- newmonth = line.split(" ")[2]
- newmonth_num = months.index(newmonth)
- if newmonth_num >= currentmonth_num:
- times[acc] = line[10:len(line2)-1]
- for acc in times.keys():
- print "Last Login ("+acc+"): "+str(times[acc])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement