Marco Mariani wrote:
norseman wrote:
The posting needs (its creation) ... DATE. ... The code needs to
state OS and program and version used to write it. And from there -
user beware."
Which would reduce the confusion greatly. I got the same error
message and decided it was from an incomp
norseman wrote:
The posting needs (its creation) ... DATE. ... The code needs to state
OS and program and version used to write it. And from there - user
beware."
Which would reduce the confusion greatly. I got the same error message
and decided it was from an incompatible version, using
Marco Mariani wrote:
djc wrote:
Python 2.5.2 (r252:60911, Oct 5 2008, 19:29:17)
geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
^
SyntaxError: invalid syntax
The byte type is new in 2.6
--
http://mail.py
djc wrote:
Python 2.5.2 (r252:60911, Oct 5 2008, 19:29:17)
geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
^
SyntaxError: invalid syntax
The byte type is new in 2.6
--
http://mail.python.org/mailman/listi
Raymond Hettinger wrote:
> import hashlib
>
> def geohash(latitude, longitude, datedow):
> '''Compute geohash() in http://xkcd.com/426/
>
> >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
> 37.857713 -122.544543
>
> '''
> h = hashlib.md5(datedow).hexdigest()
>
Raymond Hettinger writes:
> p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], ...
Cool, I didn't know about 'fromhex'.
--
http://mail.python.org/mailman/listinfo/python-list
import hashlib
def geohash(latitude, longitude, datedow):
'''Compute geohash() in http://xkcd.com/426/
>>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
37.857713 -122.544543
'''
h = hashlib.md5(datedow).hexdigest()
p, q = [('%f' % float.fromhex('0.' + x)) for x