0

to simplify the problem, I want to use subprocess.call to write a simple string such as "abc" into a dummy file called "test"

subprocess.call(["echo", "abc", ">", "/data/test"])

the result is not as expected: it outputs on the console

abc > /data/test

kaileena
  • 119
  • 9
  • 1
    Possible duplicate of [How to redirect output with subprocess in Python?](https://stackoverflow.com/q/4965159/608639) and [Piping output of subprocess.Popen to files](https://stackoverflow.com/q/2331339/608639) – jww Feb 16 '19 at 23:41
  • 1
    Note that the accepted answer on the dupe is not the best one, there's another with more votes – that other guy Feb 16 '19 at 23:46
  • ok. i undersatnd it is just not possible with subprocess.call to redirect output. – kaileena Feb 17 '19 at 13:56

0 Answers0