title: How to make Python.exe stay open when running from Windows Task Scheduler
body: <p>I am running a .py file from Windows Task Scheduler.  For most files this works fine as follows:</p>
  
  <ol>
  <li>Create new task in TS</li>
  <li>In TS on the "Actions" tab under "Program/script:" specify the path to python.exe (Example: C:\Users\User\Python.exe)</li>
  <li>In TS in the "Add arguments" section, add the path to the .py file in quotes (Example: "C:\Path\To\Py\pythonfiletorun.py")</li>
  </ol>
  
  <p>When this works correctly, Python.exe pops up for a split second, runs the program and vanishes.  </p>
  
  <p>However, I have one .py file that isn't working.  When I try to run it from QT Console it works fine.  When I use the TS process it fails.  And the Python.exe closes so fast I can't see what is wrong.  </p>
  
  <p>I tried converting everything to a batch file so "Program/script" becomes "cmd" and "Add arguments" becomes: /k "C:\Path\To\batchfile.bat" which then houses the paths and instructions.  </p>
  
  <p>This opens a command prompt (and keeps it open) but from here the main command prompt opens the python.exe command prompt which runs and closes just as fast.</p>
  
  <p>I tried placing the /k in various places to no avail. </p>
  
  <p>I also tried putting an input qualifier at the end of the .py script (Ex: input("Press any key to...") in hopes that would cause the Python.exe command to stay open but it doesn't.  </p>
  
  <p>Ultimately, I need the Python.exe command to stay open to see what is wrong. </p>