Python Forum
input-external program-output - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: input-external program-output (/thread-2182.html)



input-external program-output - baolevani - Feb-24-2017

Hi All,
How can I call an external program in python, feed .txt file and retrieve the output.
Thanks!


RE: input-external program-output - Larz60+ - Feb-24-2017

Could you please elaborate, this is not a very detailed description of what you'd like to do


RE: input-external program-output - nilamo - Mar-27-2017

1) subprocess module
2)
with open("somefile.txt") as fin:
    for line in fin:
        print(line.swapcase())