Dollar question mark ($?) is used to find the return value of the last executed command and I want to use it in my script but it does not work.
python version : 3.7 Library : subprocess
I searched the answer but I can't find the suit answer in python.
I tried the following code, but it doesn't work :
#!/usr/bin/python
import subprocess
subprocess.call(["ls","-l"])
if $? == 0 :
print("is ok\n")