main.py
def run_code(executable: str, input_src: str):
    """
    run_code takes in @executable binary to run, while input_src
    is a bytes-string to be pass into the stdin of the program.
    Inputs must be sperated by a \n in the input-src. The \n acts 
    as the Enter key while manually entring the input.
    TODO: add alarm and timer to time execution of program.
        add a kill switch to kill the child process after provided time
        properly format the actual and expected output
    """

    cmd = "./" + executable
    p = subprocess.Popen(cmd,
                         shell=True,
                         stdout=subprocess.PIPE,
                         stdin=subprocess.PIPE,
                         stderr=subprocess.PIPE)

    std_out, std_err = p.communicate(input=input_src)

    return std_out

    run_code takes in @executable binary to run, while input_src
    is a bytes-string to be pass into the stdin of the program.
    Inputs must be sperated by a \n in the input-src. The \n acts 
    as the Enter key while manually entring the input.
    TODO: add alarm and timer to time execution of program.
        add a kill switch to kill the child process after provided time
        properly format the actual and expected output
    
run_code takes in @executable binary to run, while input_src
is a bytes-string to be pass into the stdin of the program.
Inputs must be sperated by a \n in the input-src. The \n acts
as the Enter key while manually entring the input.
TODO: add alarm and timer to time execution of program.
add a kill switch to kill the child process after provided time
properly format the actual and expected output
run_code takes in @executable binary to run while input_src is a bytes - string to be pass into the stdin of the program . Inputs must be sperated by a \ n in the input - src . The \ n acts as the Enter key while manually entring the input . TODO : add alarm and timer to time execution of program . add a kill switch to kill the child process after provided time properly format the actual and expected output
def run_code(executable: str, input_src: str):
    cmd = "./" + executable
    p = subprocess.Popen(cmd,
                         shell=True,
                         stdout=subprocess.PIPE,
                         stdin=subprocess.PIPE,
                         stderr=subprocess.PIPE)
    std_out, std_err = p.communicate(input=input_src)
    return std_out
def run_code ( executable : str , input_src : str ) : cmd = "./" + executable p = subprocess . Popen ( cmd , shell = True , stdout = subprocess . PIPE , stdin = subprocess . PIPE , stderr = subprocess . PIPE ) std_out , std_err = p . communicate ( input = input_src ) return std_out
run_code takes in @executable binary to run, while input_src
is a bytes-string to be pass into the stdin of the program.
run_code takes in @executable binary to run while input_src is a bytes - string to be pass into the stdin of the program .
"""
    run_code takes in @executable binary to run, while input_src
    is a bytes-string to be pass into the stdin of the program.
    Inputs must be sperated by a \n in the input-src. The \n acts 
    as the Enter key while manually entring the input.
    TODO: add alarm and timer to time execution of program.
        add a kill switch to kill the child process after provided time
        properly format the actual and expected output
    """
executable
str
input_src
str