Pretty straightforward port - a huge portion of the code is drawing ASCII art of Earth.
I also took the liberty of deleting unnecessary work to get the argument to math.cos to lie between -180 and 180 degrees. Maybe that was important back in the day.