text: import os
  from os import *
  import tkinter
  from tkinter import *
  from tkinter.ttk import *
  from tkinter import messagebox
  from serial import *
  import serial.tools.list_ports
  
  # Iterate through available serial ports
  serial_ports = serial.tools.list_ports.comports()
  serial_port_id = []
  print (serial_ports[0])
  print (serial_ports[1])
  
  for a, b, c in sorted(serial_ports):
      serial_port_id.append(a) # save only port value to serial_ports
      print(serial_port_id)
  
  root = Tk()
  
  com_sel = ""
  
  class Window(Frame):
      def __init__(self, master=None):
          Label(text="uh").place(x = 4, y = 4)
          # COM Select dropdown
          port_box = StringVar()
          port_box = Combobox(values=serial_port_id)
          port_box.grid(row = 1, column = 1)
          
          # COM Select confirmation
          def select_port():
              com_sel = port_box.get()
              messagebox.showinfo("Port Selection","Selected {}".format(com_sel))
  
          com_sel_btn = Button( text="Select", command=select_port)
          com_sel_btn.grid(row = 1, column = 2)
  
  
  print(com_sel)
  
  
  app = Window(root)
  root.title("mapCNC v0-DEV")
  root.geometry("800x600")
  
  root.mainloop()
  
  