How does python call interactive C language programs?

now there is a binary program shown in the following figure. Generally, I enter. / itool daily25.cfg directly into the interface, and then choose the corresponding input according to my own needs. Now I want to call the script with python instead. The input is fixed, for example, 5, 4, 4 and 1 in turn. Ask the great god for advice on what to do. You can also use the shell script
clipboard.png

Mar.03,2021

import os
import sys
for i in sys.argv[1:]:
    os.system('./itool {}.cfg'.format(i))
Menu