Example #1
0
def run_c_sharp_code(c_sharp_file):
    compile_c_sharp()
    c_sharp_input = get_input_from_file(c_sharp_file)
    c_sharp_input = check_for_multi_runs(c_sharp_input)

    for input_sequence in c_sharp_input:
        print('INPUT:\n', input_sequence)
        print('==================== PROGRAM OUTPUT ====================')
        execute_and_print_in_shell('mono', 'run.exe')
Example #2
0
def run_java_code(java_file):
    compile_java(java_file)
    java_input = get_input_from_file(java_file)
    java_input = check_for_multi_runs(java_input)

    for input_sequence in java_input:
        print('INPUT:\n', input_sequence)
        print('==================== PROGRAM OUTPUT ====================')
        execute_and_print_in_shell('java', java_file, input_sequence)
Example #3
0
def run_verilog_code(verilog_file):
    if verify_verilog_code(verilog_file):
        vvp_file = f'{verilog_file}vp'
        compile_verilog(vvp_file, verilog_file)
        execute_and_print_in_shell('vvp', vvp_file)
Example #4
0
def run_cpp_code(filename):
    execute_and_print_in_shell("g++", filename)

    p = Popen(["./a.out"], stdout=PIPE, stdin=PIPE, stderr=PIPE)
    print_output_communication(p.communicate(), filename)
Example #5
0
def run_python_code(python_file):
    execute_and_print_in_shell('python3.9', python_file)
Example #6
0
def run_c_code(filename):
    execute_and_print_in_shell('gcc', filename)

    p = Popen(['./a.out'], stdout=PIPE, stdin=PIPE, stderr=PIPE)
    print_output_communication(p.communicate(), filename)