最近刷卡总觉得手续费不对
所以弄了一个手续费计算的软件
全程是用通义千问搞定
因为我什么编程语言都不会
纯纯的小白一个
打包成exe也是通过通义千问搞定的
甚至我都不会上传logo
所以这个软件理论上是通义千问原创的
软件有两种计算方式
1、通过刷卡金额以及到账金额算出手续费和费率
2、通过费率以及刷卡金额算出到账金额以及手续费
源码和下载地址在下面
[Python] 纯文本查看 复制代码 import tkinter as tk
from tkinter import messagebox
def calculate_by_amounts():
initial_amount = float(initial_amount_entry.get())
settled_amount = float(settled_amount_entry.get())
service_charge = initial_amount - settled_amount
if service_charge < 0:
messagebox.showerror("错误", "到账金额不能大于刷卡金额,请重新输入。")
return
rate = (service_charge / initial_amount) * 100
messagebox.showinfo("结果", f"手续费为:{service_charge:.2f}元\nPOS机的费率为:{rate:.2f}%")
def calculate_by_rate():
initial_amount = float(initial_amount_entry.get())
rate_percentage = float(rate_percentage_entry.get())
service_charge = initial_amount * rate_percentage / 100
settled_amount = initial_amount - service_charge
messagebox.showinfo("结果", f"手续费为:{service_charge:.2f}元\n到账金额为:{settled_amount:.2f}元")
def main():
global initial_amount_entry, settled_amount_entry, rate_percentage_entry
window = tk.Tk()
window.title("POS机费率计算器")
window.geometry("400x300") # 设置窗口初始大小
tk.Label(window, text="刷卡金额(元):").pack()
initial_amount_entry = tk.Entry(window)
initial_amount_entry.pack()
tk.Label(window, text="到账金额(元):").pack()
settled_amount_entry = tk.Entry(window)
settled_amount_entry.pack()
tk.Label(window, text="费率(%):").pack()
rate_percentage_entry = tk.Entry(window)
rate_percentage_entry.pack()
tk.Button(window, text="按金额计算", command=calculate_by_amounts).pack()
tk.Button(window, text="按费率计算", command=calculate_by_rate).pack()
window.mainloop()
if __name__ == "__main__":
main()
https://wwp.lanzouj.com/iZXIu219d0hi
密码:a20b |