This small script is based on a github repo by Ye-Sheng Kuo. Thanks for giving me the permission to use and share your code!
Currently, this script works for Tektronix TDS2014B, RIGOL DS1000Z and SDS1104X-E scopes and all scopes that share the same programming interface as the listed models.
Give your device all rights you need to access it: http://ask.xmodulo.com/change-usb-device-permission-linux.html
This solves this issue: pyvisa/pyvisa#212