You should use the subprocess
module instead of os.startfile
or os.system
in every case that I'm aware of.
import subprocess
subprocess.Popen([r'C:estsample.exe', '-color'])
You could, as @Hackaholic suggests in the comments, do
import os
os.system(r'C:estsample.exe -color')
But this is no simpler, and the docs for os
recommend the use of subprocess
instead.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…