pycurrency examples

This serves as primitive test suite and documentation of some examples.

Using the Converter

First import converter from the pycurrency module:

>>> from pycurrency import converter
>>> myconverter = converter.Converter(1,'USD','JMD')

Now let’s test it:

>>> result = myconverter.result()
>>> result = float(result)
>>> type(result)
<type 'float'>

It should be possible to also change currency:

>>> myconverter.from_cur = 'EUR'
>>> myconverter.query['from']
'USD'
>>> output = myconverter.update()
>>> myconverter.query['from']
'EUR'

Project Versions

Table Of Contents

Previous topic

Overview

This Page