geekcomputers / geekcomputers/Python
currency converter
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 35.4k
- Forks
- 12.9k
- Avg merge
- 2h 37m
- Merged PRs (30d)
- 1
Description
cc program
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5 import QtWidgets, uic
from PyQt5.QtCore import *
import requests
from bs4 import BeautifulSoup
from requests.models import ContentDecodingError
def getVal(cont1, cont2):
cont1val = cont1.split("-")[1]
cont2val = cont2.split("-")[1]
url = f"https://free.currconv.com/api/v7/convert?q={cont1val}_{cont2val}&compact=ultra&apiKey=b43a653672c4a94c4c26"
r = requests.get(url)
htmlContent = r.content
soup = BeautifulSoup(htmlContent, "html.parser")
try:
valCurr = float(soup.get_text().split(":")[1].removesuffix("}")) # {USD:70.00}
except Exception:
print("Server down.")
exit()
return valCurr
app = QtWidgets.QApplication([])
window = uic.loadUi("gui.ui")
f = open("country.txt", "r")
window = uic.loadUi("C:/Users/prath/Desktop/Currency-Calculator-Dynamic/gui.ui")
f = open("C:/Users/prath/Desktop/Currency-Calculator-Dynamic/country.txt", "r")
window.dropDown1.addItem("Select")
window.dropDown2.addItem("Select")
for i in f.readlines():
window.dropDown1.addItem(i)
window.dropDown2.addItem(i)
intOnly = QDoubleValidator()
window.lineEdit.setValidator(intOnly)
def main():
window.pushButton.clicked.connect(changeBtn)
def changeBtn():
val = window.lineEdit.text()
cont1 = window.dropDown1.currentText()
cont2 = window.dropDown2.currentText()
valCurr = getVal(cont1.rstrip(), cont2.rstrip())
window.lcdpanel.display(float(val) * valCurr)
main()
window.show()
app.exec()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue mentions gui.ui, country.txt, and a PyQt5 program in the body. First inspect those files and the repository entry point, then clarify the intended change and expected currency-conversion behavior; done cannot be defined from the issue as written.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100