Reading a file without blocking the main thread Background Info: Running Python 3.6 on Windows 10

I have a text file parsed like this:

Ann Marie,Smith,ams@cia.com


There can over 100+ names in the text file.

Goal: When the program starts up, read in the text file using a thread, and load the data into a combobox. The main thread can continue loading other GUI components and isn't blocked by the method reading the text file. 

import wx
import concurrent.futures


class MyDialog(wx.Frame):

    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, title=title, size=(250, 270))

        self.panel = wx.Panel(self, size=(250, 270))
        self.combo = wx.ComboBox(self.panel, -1, pos=(60, 100))
        self.start_read_thread()

        # code to load other GUI components

        self.Centre()
        self.Show(True)

    def read_employees(self,read_file):
        emp_list = []
        with open(read_file) as f_obj:
            for line in f_obj:
                emp_list.append(line)
        wx.CallAfter(self.combo.Append, emp_list)

    def start_read_thread(self):
        filename = 'employees.txt'
        with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:
            executor.submit(self.read_employees, filename)


app = wx.App(False)
frame = MyDialog(None, "Sample editor")
app.MainLoop()
Not much to remark on. Beside some lack of documentation about which thread each function is expected to run in.

You can also do incremental append as you are reading to let the user see you are still doing something in case the file is really massive or slow to read: 

def read_employees(self,read_file):
    emp_list = []
    with open(read_file) as f_obj:
        for line in f_obj:
            emp_list.append(line)
            if len(emp_list) &gt; 5 #adjust as needed
                wx.CallAfter(self.combo.Append, emp_list)
                emp_list = []
    wx.CallAfter(self.combo.Append, emp_list)