CS 1MD3 - Winter 2006 - Assignment #5

Generated for Student ID: 0561326

Due Date: April 5th, 2006

(You are responsible for verifying that your student number is correct!)
NOTE: All submissions must be plain text format in ".py" files.

Instructions

Using the libraries sys and urllib, write a Python program to convert the value of a given amount of money from one currency to another. Your program will prompt the user for two 3-letter currency codes (the "from" currency, and the "to" currency) along with a floating-point value. It will acquire the conversion from www.oanda.com, extract the relevant text, and display it in the console. Here are some results which your program should reproduce (with current monetary values, of course):
$ python currency.py
Convert from: CAD
Convert to: USD
Amount: 23.59
                 23.59 Canadian Dollar = 20.41788 US Dollar

$ python currency.py 
Convert from: EUR 
Convert to: JPY 
Amount: 84.24
                 84.24 Euro = 11,947.6 Japanese Yen

$ python currency_cmdline.py 
Convert from: ISK 
Convert to: GTQ 
Amount: 123.45
                 123.45 Iceland Krona = 13.66300 Guatemalan Quetzal

The URL: http://www.oanda.com/convert/classic

Notes: