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

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -