Added python equivalent (hopefully)

I dun like da PHP
Merge pull request #1 from IllegalLeft/patch-1

Added python equivalent (hopefully)