geopoint = {'latitude':41.123,'longitude':71.091}

print('{latitude} {longitude}'.format(**geopoint))


this should be good for you. 

Or: 

d = dict(foo='x', bar='y', baz='z')
'foo is {foo}, bar is {bar} and baz is {baz}'.format_map(d)
or more complex case:
>>> p1 = {'latitude':41.123,'longitude':71.091}
>>> p2 = {'latitude':56.456,'longitude':23.456}
>>> '{0[latitude]} {0[longitude]} - {1[latitude]} {1[longitude]}'.format(p1, p2)
'41.123 71.091 - 56.456 23.456'

0 comments

Popular Posts

无觅相关文章插件,迅速提升网站流量