Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

currency converter

未关闭
#2,401 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
20/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
python
领域
desktop

调研方向

Issue 正文提到了 gui.ui、country.txt 和一个 PyQt5 程序。首先检查这些文件和 repository 的入口点,然后明确预期的更改以及预期的货币转换行为;根据目前的 issue 描述,无法定义何时算作 done。

由索引模型根据 Issue 内容生成。

描述

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()

主要语言
Python
星标
35.4k
派生
12.9k
平均合并
2 小时 37 分钟
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

geekcomputers/Python 的其他 Issue

查看 geekcomputers/Python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。