Los nuevos teléfonos Nokia symbian s60 vienen con una brújula digital, a la cual podemos acceder desde Python.

Les dejo el código:

Código:
from sensor import *
import e32


class DemoApp():

    def __init__(self):
        self.magnetometer = \
            MagnetometerXYZAxisData(data_filter=LowPassFilter())
        self.magnetometer.set_callback(data_callback=self.my_callback)
        self.counter = 0

    def my_callback(self):
        # For stream sensor data the callback is hit 35 times per sec(On 
        # 5800). The device cannot handle resource hungry operations like
        # print in the callback function for such high frequencies. A 
        # workaround is to sample the data as demonstrated below.
        if self.counter % 5 == 0:
            print  "Calib:", self.magnetometer.calib_level
            print "X:%s, Y:%s, Z:%s" % (self.magnetometer.x,
                                   self.magnetometer.y, self.magnetometer.z)
        self.counter = self.counter + 1

    def run(self):
        self.magnetometer.start_listening()

if __name__ == '__main__':
    d = DemoApp()
    d.run()
    e32.ao_sleep(39)
    d.magnetometer.stop_listening()
    print "Exiting MagnetometerAxis"