This is a simple currency converter application developed using Python and Tkinter. The application allows users to convert amounts between different currencies based on predefined exchange rates.
- Convert between USD, PKR, INR, and TAKA.
- Simple and intuitive GUI built with Tkinter.
- Easy to use: just enter the amount, select the currency, and click convert.
The application uses the following predefined exchange rates:
- 1 USD = 278.55 PKR
- 1 USD = 83.47 INR
- 1 USD = 117.49 TAKA
- 1 INR = 3.34 PKR
- 1 TAKA = 2.37 PKR
- 1 INR = 1.41 TAKA
- Python 3.x
- Tkinter (included with most Python installations)
- Clone the repository or download the source code.
git clone https://github.com/shabanazfar/currency-converter.git
- Navigate to the project directory.
cd currency-converter
- Run the
currency_converter.py
script.python currency_converter.py
- The GUI will open. Enter the amount you want to convert.
- Select the currency of the entered amount from the dropdown menu.
- Click the "Convert" button to see the converted amounts in other currencies.
Here is an example of the currency conversion logic implemented in the application:
def currency_converter():
amount = float(amount_entry.get())
currency = currency_var.get()
if currency == "USD":
pkr = amount * USD_to_PKR
inr = amount * USD_to_INR
taka = amount * USD_to_TAKA
result_var.set(f"PKR: {pkr:.2f}\nINR: {inr:.2f}\nTAKA: {taka:.2f}")
elif currency == "PKR":
usd = amount / USD_to_PKR
inr = amount / INR_to_PKR
taka = amount / TAKA_to_PKR
result_var.set(f"USD: {usd:.2f}\nINR: {inr:.2f}\nTAKA: {taka:.2f}")
elif currency == "INR":
usd = amount / USD_to_INR
pkr = amount * INR_to_PKR
taka = amount * INR_to_TAKA
result_var.set(f"USD: {usd:.2f}\nPKR: {pkr:.2f}\nTAKA: {taka:.2f}")
elif currency == "TAKA":
usd = amount / USD_to_TAKA
pkr = amount * TAKA_to_PKR
inr = amount / INR_to_TAKA
result_var.set(f"USD: {usd:.2f}\nPKR: {pkr:.2f}\nINR: {inr:.2f}")
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.