I am trying to get the IP address and other details of Linux through my python code. when tmp = subprocess.call("./a.out")
this line executes the code sticks here and this line subprocss.call("ifconfig")
is not executed. as I cannot change the C code. so how can I make the next line run.
def execute():
dirname = '/home/kali/Downloads'
ext = ('.py','.c','.sh')
try:
for files in os.listdir(dirname):
if files.endswith(ext):
if files.endswith('.c'):
subprocess.call(["gcc", "code.c"])
tmp = subprocess.call("./a.out")
subprocss.call("ifconfig")