currency convertor using python and xe.com
amountpounds = raw_input("How many Euros do you want to convert? ")
import msvcrt
import urllib
params = urllib.urlencode({'Amount': amountpounds, 'From' : 'EUR', 'To' : 'GBP'})
currency = urllib.urlopen("http://xe.com/ucc/convert.cgi?",params)
data = currency.read()
import re
euros = re.search ( '(\d*)\.(\d*) GBP', data )
print amountpounds, 'Euros are equal to...'
print euros.group ( 1 ) + '.' + euros.group ( 2 ), 'Pounds.'
msvcrt.getch()
use the above code and modify it for your currency convertor
have a nice day:)

0 Comments:
Post a Comment
<< Home