from selenium import webdriver
from selenium.webdriver.common.by import By as by
from selenium.webdriver.common.keys import Keys as key
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from interface2 import *
import tkinter.messagebox as msg
import time
import sys
class CurrencyConverter(QMainWindow):
def __init__(self):
super().__init__()
self.ui = Ui_Interface()
self.ui.setupUi(self)
self.show()
self.ui.amountbox.setVisible(0)
self.ui.fromlist.currentTextChanged.connect(lambda: self.checker())
self.ui.tolist.currentTextChanged.connect(lambda: self.checker())
def checker(self):
if self.ui.current1_from.text() == self.ui.current2_to.text() or self.ui.current2_to.text() == self.ui.current1_from.text():
msg.showerror(message="You cannot select the same currency as the selected currency in the other list.")
if __name__ == '__main__':
app = QApplication(sys.argv)
myWindow = CurrencyConverter()
app.exec_()