mardi 19 juillet 2016

Receiving data from a certain website

I would like to understand how applications are receiving information from the internet.

In particular, I made myself two functions in Python where I convert two foreign currencies.

The code:

#Converts from DKK to TRY
def currencyConverterToDKK(TRY):
amount = float(TRY * 2.25)
print (amount)

#Converts from TRY to DKK
def currencyConverterToTRY(DKK):
    amount = float(DKK * 0.4436)
    print (amount)

Obviously I do not want to change the currencies manually, but instead parsing a particular currency whenever I run the program.

How can I obtain these currency values from a website and implement them into my so-called program?

Aucun commentaire:

Enregistrer un commentaire