Dijkstra and A* take the weight of the fields on the map into account. If you are still using python 2 take a look at the (unmaintained) python2-branch. For usage examples with detailed descriptions ...
1. Create a map using a 2D-list. Any value smaller or equal to 0 describes an obstacle. Any number bigger than 0 describes the weight of a field that can be walked on. The bigger the number the higher ...