i have a python script which should invoke a .exe file to get some result. That .exe file is invoking a new windows command prompt(shell) . i dont need any output from the .exe file.
i ‘m using
os.system(‘segwin.exe args’) in my script where segwin is an executable.
now my question is : i need to stop invoking cmd prompt
kudos to all
sag
Try this (untested):
Note that
check_callchecks the return code of the launched subprocess and raises an exception if it’s nonzero. If you don’t want that, usecallinstead.In general, avoid
os.system()and use thesubprocessmodule whenever possible.os.system()always starts a shell, which is nonportable unnecessary on most cases.