[Pyobjc-dev] CLLocationManager
Brought to you by:
ronaldoussoren
|
From: Stefan S. <st....@go...> - 2010-04-05 15:31:57
|
Hi,
I'm trying to use CLLocationManager from Python. Althoug I don't get an
error, I also do not get any output.
Does someone have some experience with this?
Brgds,
Stefan
<python>
import objc
from Foundation import *
import time
objc.loadBundle("CoreLocation", globals(),
"/System/Library/Frameworks/CoreLocation.framework")
class LocationDelegate(NSObject):
def locationManager_didUpdateToLocation_fromLocation_(self, manager,
newlocation, oldlocation):
print manager
print newlocation
print oldlocation
def didFailWithError_(self, error):
print error
delegate = LocationDelegate.alloc().init()
print (delegate)
myLocMgr = CLLocationManager.alloc().init()
print (myLocMgr)
myLocMgr.setDelegate_(delegate)
accuracy = -1.0
myLocMgr.setDesiredAccuracy_(accuracy)
myLocMgr.startUpdatingLocation()
#time.sleep(10)
myLoc = myLocMgr.location()
print (myLoc)
</python>
|