#!/usr/bin/env python3 """ ZetCode Tkinter tutorial In this example, we use the pack manager to create a review example. Author: Jan Bodnar Website: www.zetcode.com """ from tkinter import Tk, Text, TOP, BOTH, X, N, LEFT from tkinter.ttk import Frame, Label, Entry, Button from libs.paylib import Transaction class Pay(Frame): def __init__(self): super().__init__() self.initUI() def initUI(self): self.master.title("Paiement Ḡ1") self.pack(fill=X) frame1 = Frame(self) frame1.pack(fill=X) recipientLabel = Label(frame1, text="Destinataire:", width=12) recipientLabel.pack(side=LEFT, padx=5, pady=5) self.recipientEntry = Entry(frame1) self.recipientEntry.pack(fill=X, padx=5, expand=True) frame2 = Frame(self) frame2.pack(fill=X) AmountLabel = Label(frame2, text="Montant:", width=12) AmountLabel.pack(side=LEFT, padx=5, pady=5) self.AmountEntry = Entry(frame2) self.AmountEntry.pack(fill=X, padx=5, expand=True) frame3 = Frame(self) frame3.pack(fill=X) commentLabel = Label(frame3, text="Commentaire:", width=12) commentLabel.pack(side=LEFT, padx=5, pady=5) self.commentEntry = Entry(frame3) self.commentEntry.pack(fill=X, padx=5, expand=True) frame4 = Frame(self) frame4.pack() self.sendButton = Button(frame4, text="Envoyer", command=self.ProceedPaiement) self.sendButton.pack(side=LEFT, padx=5, pady=5, expand=True) def ProceedPaiement(self): recipient = str(self.recipientEntry.get()) amount = int(self.AmountEntry.get()) comment = str(self.commentEntry.get()) print("Paiement en cours ... " + recipient) trans = Transaction(recipient, amount, comment) trans.send() recipient = amount = comment = None def main(): root = Tk() root.geometry("300x130+300+300") app = Pay() root.mainloop() if __name__ == '__main__': main()