I have a problem with Popen.communicate ().
I have a script that returns a string.
Then I wrote a second script that takes this variable.
v = "./myscript arg1 arg2" com = subprocess.Popen(v, shell=True).communicate() print com
com returns (None, None). The fact is that I can print inside the first script of the results, the result of printing the shell. I cannot just assign this print to a variable.
Of course, the script first returns the value, rather than printing it.
source share