This program handles the I2C communication between a Raspberry Pi and a MPU-6050 Gyroscope/Accelerometer sensor.
For this program to work you need to have I2C enabled on your Raspberry Pi and you need to have the python-smbus package installed.
A Python module to handle the I2C communication between a Raspberry Pi and a MPU-6050
PythonMIT