osx - Failed with running subprocess from Python launcher without terminal window on Mac -


my ultimate goal run python script (the code need call subprocess) without terminal.

i tried python launcher on mac. code works correctly when "run in terminal window" checked.

(notice shell=false default here.) however, won't run subprocess correctly when uncheck option.

i tried run in mac os automator (run shell script) — negative too.

here small sample code.

import subprocess  open("record","w") f:     subprocess.call(["which","ipython"], stdout = f)  # line fails     subprocess.call(["open","."])  # line works 

if run terminal, creates record file, shows ipython path. when run automator or python launcher without terminal window, creates empty file.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -