[Python] - Getting data from external program
- by Kenny M.
Hey,
I need a method to get the data from an external editor.
def _get_content():
from subprocess import call
file = open(file, "w").write(some_name)
call(editor + " " + file, shell=True)
file.close()
file = open(file)
x = file.readlines()
[snip]
I personally think this is a very ugly way. You see I need to interact with an external editor and get the data.
Do you know any better approaches/have better ideas?