Created
September 6, 2017 12:43
-
-
Save leotada/ef4f6ec085b242c3aada09c861d531d5 to your computer and use it in GitHub Desktop.
Python subprocess without window
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def runprocess(command): | |
"Executa subprocess multiplataforma sem exibir janela. Retorna o returncode." | |
startupinfo = None | |
if os.name == 'nt': | |
startupinfo = subprocess.STARTUPINFO() | |
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW | |
retcode = subprocess.check_call(command, startupinfo=startupinfo) | |
return retcode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment