1

I prepared .py script, which i run from command line. ('python test.py') The last task of my script is to launch external application. I use below function to launch independent process (.exe file)

subprocess.Popen(["C:/Program Files/Agisoft/PhotoScan Pro/photoscan.exe", (folder_z_nazwa+".psx")], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

I would like to close cmd without terminating this subprocess. At this moment Agisoft is launched with cmd in background. When i click exit button on cmd window, agisoft is terminated immediately. I don't expect closing cmd automatically. I just want to avoid situation that user close cmd window accidentally and Agisoft will be closed too.

1 Answers1

0
pythonw script_name.py 

This will run your script in background,Even if you close cmd .

sachin dubey
  • 755
  • 9
  • 28