# Check value correspondng to
# status key in cell dictionary
if
cell['status'] ==
'OK'
:
# insert method inserting the
# value in the text entry box.
# Extracting useful information
# from cell dictionary and inserting
# into the respective text fields.
distance_field.insert(10, cell['distance']['text'])
duration_field.insert(10, cell['duration']['text'])
else
:
# insert method inserting the
# value in the text entry box.
# Extract value corresponding to
# status key from cell dictionary and
# inserting into the respective text fields.
mode_field.insert(10, cell['status'])
distance_field.insert(10, cell['status'])
# Function for getting values from
# respective text entry boxes and
# calling result function .
def
find() :
# get method returns current text
# as a string from text entry box
source =
source_field.get()
destination =
destination_field.get()
travel_modes =
mode_field.get()
# Calling result() Function
result(source, destination, travel_modes)
# Function for inserting the train string
# in the mode_field text entry box
def
train() :
mode_field.insert(10, "train")
# Function for inserting the driving string
# in the mode_field text entry box
def
driving() :
mode_field.insert(10, "driving")
# Function for inserting the walking string
# in the mode_field text entry box
def
walking() :
mode_field.insert(10, "walking")
# Function for clearing the contents
# of source_field, distance_field,
# duration_field text entry boxes.
def
del_source() :
source_field.delete(0, END)
distance_field.delete(0, END)
duration_field.delete(0, END)








暂无数据