How to perform input redirection in python like the bash >?
Question: I want to feed text files to a C program, with bash I can do `./prog <file`,
how would you do the same in python ?


Answer: You can do that via
[`subprocess.check_call`](https://docs.python.org/3/library/subprocess.html#subprocess.check_call):

    
    
    import subprocess
    
    subprocess.check_call(["prog"], stdin=open("/path/to/file"))
    

