I know there's a way to access output using subprocess.check_output:
output = subprocess.check_output(["python", "nxptest.py", "my_testlist.txt"])
but what is I need to go to nxptest.py first and access the function present in that module. eg.
python commands_for_nxptest.py
which opens up interactive consol and then
get_test_no()
where get_test_no()
is function defined in commands_for_nxptest.py
module.
How should I do that using subprocess.check_output
??
I tried :
output = subprocess.check_output("python commands_for_nxptest.py")
time.sleep(0.5)
output1 = subprocess.check_output("get_test_no()")
print output1
This doesn't work though..