title: Python program with selenium(webdriver) Don't Work as single and noconsole exe file (pyinstaller)
body: <p>The following is my python code:</p>
  
  <pre><code>## t.py ##
  
  from tkinter import messagebox
  from tkinter import *
  from selenium import webdriver
  
  def clicked():
      iedriver = "C:\\Program Files\\Internet Explorer\\IEDriverServer.exe"
      try:        
          driver=webdriver.Ie(iedriver)        
      except Exception as e:        
          messagebox.showerror("Error",e)
      driver.get('www.baidu.com')  
  Top=Tk()
  Button(Top,text='Click Me',command=clicked).pack()
  Top.mainloop()
  </code></pre>
  
  <p>This works fine, but when I convert this to a single .exe file with PyInstaller(t.spec):</p>
  
  <pre><code># -*- mode: python -*-
  
  block_cipher = None
  
  
  a = Analysis(['D:\\program\\Python\\t.py'],
           pathex=['D:\\program\\Python'],
           binaries=None,
           datas=None,
           hiddenimports=[],
           hookspath=None,
           runtime_hooks=None,
           excludes=None,
           win_no_prefer_redirects=None,
           win_private_assemblies=None,
           cipher=block_cipher)
  pyz = PYZ(a.pure, a.zipped_data,
           cipher=block_cipher)
  exe = EXE(pyz,
        a.scripts,       
        a.binaries,
        a.zipfiles,
        a.datas,
        name='t',
        debug=False,
        strip=None,
        upx=False,
        console=0 , icon='D:\\program\\Python\\logo\\t.ico')
  </code></pre>
  
  <p>It will prompt the following error when clicking the button to run:
  <a href="https://i.stack.imgur.com/D1tiH.jpg" rel="nofollow noreferrer">Seems that IEDriver executable can't be recognized</a></p>
  
  <p>When I change the option "console=0" to "console=1" in the spec file, IE can be run after clicking the button. Any idea why IE can't be run when "console=0" is set?</p>