I want to block the output that becomes visible when I run subprocess.call()
.
That's the only output I want to stop, because I need the commands that run after to display.
The call is showing my password which I have set as a system variable hidden as %%mypassword%% in the file getting executed (however, it shows up in the command line interface).
from subprocess import call
with open('//path/pwhold.txt','w') as pwhold:
call(r"\\filetorun\%s.bat" % DB,stdout=pwhold)
os.unlink('//path/pwhold.txt')
This sort of works, but the file isn't deleted until after execution of the file is complete.
Are there any other ways to do this?