[SOLVED] CS代考计算机代写 python # Please use python3 to run this script

30 $

File Name: CS代考计算机代写_python_#_Please_use_python3_to_run_this_script.zip
File Size: 659.4 KB

SKU: 7405853704 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


# Please use python3 to run this script
import os
import subprocess

cdir = os.getcwd()
hwDir = cdir+”/hw/”

if not os.path.exists(‘hw’):
os.makedirs(‘hw’)

os.system(“cp hw.zip ./hw”)
os.chdir(cdir+”/hw”)
os.system(“unzip hw.zip”)

os.system(“gcc -fprofile-arcs -ftest-coverage hw.c -o hwX”)

for fname in os.listdir(“./”):
if fname.endswith(“.run”):
## We will grab the first line, the command-line args
## Then we will read all of the remaining lines.

rfile = open(fname, “r”)
cmdArgs = rfile.readline().rstrip()
stdinArgs = rfile.read()
rfile.close()

## Now we run the program with its command-line args, and we
## pass it the stdin args from the file.

cmdList = [hwDir+”hwX”] + cmdArgs.split()
result = subprocess.run(cmdList, input=str.encode(stdinArgs))

os.system(“gcov hw.c”)

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS代考计算机代写 python # Please use python3 to run this script
30 $