Пример #1
0
#!/usr/bin/env python

import bestplaces

states = bestplaces.getStates('ny')

cities = bestplaces.getCityData('las_vegas', 'nv')

temp = bestplaces.getStates()

metros = bestplaces.getMetroData('anderson', 'in')

Пример #2
0
#        cursor.execute(update_state, (i["id"], i["name"], i["id"]))
#    else:
#        cursor.execute(add_state, (i["id"], i["name"]))
#
## Insert salary information
#data_salary = {
#  'emp_no': emp_no,
#  'salary': 50000,
#  'from_date': tomorrow,
#  'to_date': date(9999, 1, 1),
#}
#cursor.execute(add_salary, data_salary)

# Make sure data is committed to the database
#cnx.commit()

#cursor.close()
#cnx.close()

states = bestplaces.getStates()

print states

#data = bestplaces.getMetros('indiana', "in", ['columbus', 'indianapolis'])
#
##data = bestplaces.getStates()
#
#data = json.loads(data)
#
#print json.dumps(data)
def state_ids():
    data = []
    ids = b.getStates()
    for state in ids:
        data.append(state['id'])
    return data