i am trying to recieve input from external text editor using python's subprocess
but I am not sure why i am getting the error
diff = subprocess.Popen('open(os.path.join(os.getcwd(), "foo.txt") "w")', stdout=subprocess.PIPE)
pr = subprocess.Popen(sublime, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, stdin=diff.stdout)
pr.wait()
if pr.returncode == 0:
msg = pr.stdout.read()
print msg
er = pr.stderr.read()
print er
fo.close()
diff = subprocess.Popen('open(os.path.join(os.getcwd(), "foo.txt") "w")', stdout=subprocess.PIPE)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1308, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
any help would be appreciated..