python ATM GUI tkinter
时间: 2023-12-15 08:32:35 浏览: 29
以下是一个简单的Python ATM GUI tkinter的例子:
```python
import tkinter as tk
class ATM:
def __init__(self, master):
self.master = master
self.master.title("ATM")
self.master.geometry("300x200")
self.label1 = tk.Label(self.master, text="Welcome to ATM", font=("Arial", 14))
self.label1.pack(pady=10)
self.button1 = tk.Button(self.master, text="Withdraw", width=10, command=self.withdraw)
self.button1.pack(pady=10)
self.button2 = tk.Button(self.master, text="Deposit", width=10, command=self.deposit)
self.button2.pack(pady=10)
self.button3 = tk.Button(self.master, text="Check Balance", width=10, command=self.check_balance)
self.button3.pack(pady=10)
self.button4 = tk.Button(self.master, text="Exit", width=10, command=self.master.quit)
self.button4.pack(pady=10)
def withdraw(self):
# Withdraw code here
pass
def deposit(self):
# Deposit code here
pass
def check_balance(self):
# Check balance code here
pass
root = tk.Tk()
app = ATM(root)
root.mainloop()
```