Hi guys, this has nothing to python or Paddy's code. This behavior is strictly related to user rights granted to user which runs python script. On Raspberry PI by default each user in in group called 'input'. Users in that group have rights to read and write to /dev/input/*.
The simplest way to tackle that problem is to add the user account you use to run the script to proper group. On major number of linux distros this group is named 'input'.