A Python-based real-time currency converter app using Tkinter for the GUI and ExchangeRate-API for fetching live exchange rates. Supports dynamic currency selection and conversion. A simple yet powerful currency converter built using Python and Tkinter for the graphical user interface. This application allows users to convert between various currencies using real-time exchange rates fetched from the ExchangeRate-API.
- Real-time currency conversion based on up-to-date exchange rates.
- Ability to convert between any two currencies.
- Simple, user-friendly graphical interface.
- Currencies loaded dynamically from the API.
- Python 3.x
requests
librarytkinter
library (usually comes pre-installed with Python)
Clone the repository to your local machine:
git clone https://github.com/your-username/currency-converter.git
cd currency-converter
You need the requests
library to fetch data from the API. Install it using pip:
pip install requests
Sign up for a free account at ExchangeRate-API and get your personal API key.
In the currency_converter.py
file, replace YOUR-API-KEY
with your actual API key:
self.api_url = f"https://v6.exchangerate-api.com/v6/YOUR-API-KEY/latest/USD"
Run the currency_converter.py
script to launch the application:
python currency_converter.py
You can now use the app to convert between different currencies. Simply select the currencies from the dropdown, enter the amount to convert, and hit the "Convert" button.
- The app fetches real-time exchange rates from the ExchangeRate-API.
- The rates are loaded dynamically into the dropdown menus for selecting the currencies to convert.
- The user enters an amount to convert and clicks "Convert."
- The app calculates the converted amount using the rates fetched from the API.
- 404 Error: If you see a 404 error while fetching rates, ensure that the API URL and your API key are correct.
- API Limit Exceeded: If you are using a free-tier API key, make sure you have not exceeded the rate limits. You may need to upgrade your API key for higher limits.
This project is open-source and available under the MIT License.