Skip to content

Instantly share code, notes, and snippets.

@seedifferently
Last active June 14, 2017 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seedifferently/f743d05d72a5db85ccc7eac93b883486 to your computer and use it in GitHub Desktop.
Save seedifferently/f743d05d72a5db85ccc7eac93b883486 to your computer and use it in GitHub Desktop.
Python ip logger defaultdict example
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