Ok, so I have this very simple python script:
import time
import sys
for i in range(25):
time.sleep(1)
print(i)
sys.exit()
When I use python to run it (/usr/local/bin/python3.6 testscript.py
), all works fine and the output reads:
1
2
3
4
etc..
With each number printed 1 second after the other.
However when I run:
/usr/bin/osascript -e 'do shell script "/usr/local/bin/python3.6 testscript.py" with prompt "Sart Testing " with administrator privileges'
There isn't any output for 25 seconds and finally it prints:
24
To the terminal.
The question is: How can I make osascript print the exact same output as when I run the Python script directly?