Knowing the longitude and latitude coordinates of two cities you can calculate the distance between them.
Use the code in
https://www.daniweb.com/software-development/python/code/490561/postal-code-zips-and-location-python
to find the coordinates.