We help IT Professionals succeed at work.
Get Started

Printing out the contents of an object to an HTML page using Django

lz7cjc asked
Last Modified: 2015-03-06
I have a library which i am trying to use but I don't know how to access parts of the returned object

The code I run in python is:
from boris import BikeChecker
from pprint import PrettyPrinter
bc = BikeChecker()
pp = PrettyPrinter()
bike_predicate = lambda x: x['nbBikes'] >= 2
nearest = bc.find_with_geo(51.49, -0.19, predicate=bike_predicate)

Open in new window

which outputs the following:
C:\Python27\python.exe C:/Users/nicka_000/Documents/Coding/websites_go_here/testing/borisbikes.py
{'distance': 0.032766888603455446,
 'station': {'id': 219,
             'installDate': 1279545900000L,
             'installed': True,
             'lat': 51.49016361,
             'locked': False,
             'long': -0.19039362,
             'name': u"Bramham Gardens, Earl's Court",
             'nbBikes': 8,
             'nbDocks': 29,
             'nbEmptyDocks': 20,
             'removalDate': None,
             'temporary': False,
             'terminalName': u'001183'}}

Process finished with exit code 0
 what I  want to do is access the lat and long variables within that object and store for later use. How would I do that

thanks very much
Watch Question
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE