p = Popen(['osascript', '-'] + args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate(scpt)
print((p.returncode, stdout, stderr))
How do I embed an AppleScript in in a Python script?