devwiki:python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
devwiki:python [2022/04/17 05:24] – [data operation] yingdevwiki:python [2022/05/02 14:36] – [system command modules] ying
Line 1135: Line 1135:
 subprocess.Popen([r'D:\Dev\Pipeline\PyDesktop\CompFolder\CompFolder.bat'], env=env2) subprocess.Popen([r'D:\Dev\Pipeline\PyDesktop\CompFolder\CompFolder.bat'], env=env2)
 </code> </code>
 +    * subprocess a console app and get return, and optionally hide the pop up console when call <code python>
 +# hide popup console for win platform only
 +startupinfo = subprocess.STARTUPINFO()
 +startupinfo.dwFlags |= 1 #subprocess.STARTF_USESHOWWINDOW
 +# startupinfo.wShowWindow = subprocess.SW_HIDE #(optional)
  
 +info=subprocess.Popen( '{0}'.format(app_path),stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE,  startupinfo=startupinfo)
 +out, err = info.communicate()
 +</code>
 ==== string related ==== ==== string related ====
  
  • devwiki/python.txt
  • Last modified: 2024/03/25 06:36
  • by ying