Last active
June 14, 2017 17:26
-
-
Save seedifferently/f743d05d72a5db85ccc7eac93b883486 to your computer and use it in GitHub Desktop.
Python ip logger defaultdict example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ip_timestamps = collections.defaultdict(list) | |
# ...other code that handles the web service request... | |
ip_timestamps[req.ip_address].append(time.time()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment