There could be many things wrong as your question is a little vague. I'll try and list some possible issues.
In Windows paths you have to use backslashes '\'. In your error it looks like you are passing 'd:/study' which is not a valid Windows path.
You should not be using os.popen
to call an external program. Please look at examples using the subprocess
module, http://docs.python.org/2/library/subprocess.html.
You could do something like:
import subprocess
import sys
script, filename = sys.argv
output = subprocess.check_output(["cacls", filename]).splitlines()
for i in output:
print(i)
There is no reason here to use a function here in a script file. I've also tried to follow standard Python (PEP8) formatting of variables, how to properly import modules, whitespace etc.