This somewhat depends on what platform you are on. The most common way to do this is by printing ANSI escape sequences. For a simple example, here's some Python code from the Blender build scripts:
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
To use code like this, you can do something like:
print(bcolors.WARNING + "Warning: No active frommets remain. Continue?" + bcolors.ENDC)
Or, with Python 3.6+:
print(f"{bcolors.WARNING}Warning: No active frommets remain. Continue?{bcolors.ENDC}")
This will work on unixes including OS X, Linux and Windows (provided you use ANSICON, or in Windows 10 provided you enable VT100 emulation). There are ANSI codes for setting the color, moving the cursor, and more.
If you are going to get complicated with this (and it sounds like you are if you are writing a game), you should look into the "curses" module, which handles a lot of the complicated parts of this for you. The Python Curses HowTO is a good introduction.
If you are not using extended ASCII (i.e., not on a PC), you are stuck with the ASCII characters below 127, and '#' or '@' is probably your best bet for a block. If you can ensure your terminal is using a IBM extended ASCII character set, you have many more options. Characters 176, 177, 178 and 219 are the "block characters".
Some modern text-based programs, such as "Dwarf Fortress", emulate text mode in a graphical mode, and use images of the classic PC font. You can find some of these bitmaps that you can use on the Dwarf Fortress Wiki see (user-made tilesets).
The Text Mode Demo Contest has more resources for doing graphics in text mode.
figure
tells you the call signature:
from matplotlib.pyplot import figure
figure(figsize=(8, 6), dpi=80)
figure(figsize=(1,1))
would create an inch-by-inch image, which would be 80-by-80 pixels unless you also give a different dpi argument.
Best Answer
First off you will want to use the Bing Maps REST Routing Service: https://msdn.microsoft.com/en-us/library/ff701717.aspx
Creating the request URL is pretty straight forward and the same regardless of the programming language you use. For your example, to calculate driving directions for your locations you will create a route request URL like this:
Notice that the street address has %20 in place of the spaces. This is called URL encoding and is a best practice. This is easy to do in python but wanted to point it out now so you know why it's in the code sample below.
The following code sample encodes the destination, creates a URL and prints the response from the Bing Maps service. Note that I'm using Python 3.4. Depending on the version of Python you are using the code may vary slightly.
Now this prints out response from the service as a bunch of text which is actually a bunch of JSON. We will need to parse the JSON so we can extract the information that we want. To do this you will need to know the structure of the JSON response which is documented here: https://msdn.microsoft.com/en-us/library/gg636957.aspx
To parse the response you will need to import the JSON library for Python. Once you do that you can load the raw data as a JSON object and then step through the JSON object tree to grab the values you want. Since you are only calculating route between two points there will only be 1 route leg in the response. The route leg contains an array of itinerary items which contain the route step information. Here is an updated code sample that loops through each item and prints the instructions line by line: