import tkinter as tk # This is to import the library used for graphical interface
import serial #This is for serial communication

arduino = serial.Serial('com5','9600')      # com number and baud number for the Arduino
def red():                      #This is to define a function
    arduino.write(b'A')         #This is to send a signal to Arduino
def blue():
    arduino.write(b'B')

win = tk.Tk()
win.title("red and blue colors")            #This is the window title
win.configure(background="pink")       #This is to change the background color

button=tk.Button()
top = tk.Frame()
middle = tk.Frame()
bottom = tk.Frame()
top.pack()                      #The pack is to confirm a variable
middle.pack()
bottom.pack()
title= tk.Label(top ,text="LED's", font=('Indie Flower',30),background="pink")
title.pack()
Name= tk.Label(middle, text="choose your color please", font=('Indie Flower',23),background="lightseagreen")
Name.pack(side= tk.LEFT )


Red= tk.Button(bottom, text="RED", font=('Indie Flower',16),background="red", command=red)           #This is to create a button,
blue=tk.Button (bottom, text="BLUE", font=('Indie Flower',16),background="blue", command=blue)       #Here the command is to call a function

Red.pack(side= tk.LEFT)    #This to make the buttons appear next to each other
blue.pack(side= tk.LEFT)


win.mainloop()      #This is to make the window open