title: Opening up Excel via Python on macOS
body: <p>So I coded up a program that extracts data from certain websites and then exports said data to a temporary excel file(which is created at the given path if not already existing).  Below is the code for the main function.  The part I am having trouble with is starting with <code>book = xlwt.Workbook()</code> but I wanted to include everything to provide the full situation.  I coded up the program on a Windows 10 computer, and everything worked fine.  However, I need to change this to work on a mac.  I know with the mac I'm getting to at least the <code>browser.close()</code> part but after that, I have no idea if anything is working.  I am unsure if I am writing into an Excel file at all in the first place, but mostly I am having trouble figuring out how to find the path of the excel file and launching the file itself.  Can anyone help me figure out how to do the same thing I do below but just for a mac instead??</p>
  
  <pre><code>def main():
      now = datetime.datetime.now()
      option = selenium.webdriver.ChromeOptions()
      browser = selenium.webdriver.Chrome()
  
      keyword = None
      urlList = None
  
      # two different lists of data I scrapped
      wi = webInfo(browser, keyword)
      mi = mobileInfo(browser, keyword)
  
      urlList = wi+mi
  
      browser.close()
  
      book = xlwt.Workbook()
      sheet1 = book.add_sheet('sheet1')
  
      for i in range(len(urlList)):
          for j in range(len(urlList[i])):
              sheet1.write(i, j, urlList[i][j])
  
      name = "random.xls"
      book.save(name)
      book.save(TemporaryFile())
  
      excelFile = "C:/Users/me/PycharmProjects/test/random.xls"
      excelEx = r"C:/Program Files/Microsoft Office/root/Office16/EXCEL"
  
      subprocess.Popen([excelEx, excelFile])
  </code></pre>