Permission Denied Error With Subprocess.call()
Solution 1:
You are attempting to run /mnt/sdc1/user/6363/
as the name of a command, but obviously, it isn't one.
It's not clear what you are attempting to actually run, but this is not the right way to do that at all.
The first item in the list you pass as the first argument to subprocess.Popen()
and its various convenience wrappers needs to be an executable file just like you would need to type a command, not a directory name, at the shell prompt.
I'm guessing your code should look something like
defNRRDToDICOM(filename, output_folder_name):
subprocess.call(['/usr/bin/nrrdtodicom', filename, output_folder_name])
where the path to the executable might not be necessary if it's already on your PATH
(as it probaby should be -- I mainly put in the /usr/bin/
to make it really explicit that we are talking about that type of thing), and you can of course save it in a variable if you absolutely insist, but that seems like a weird thing to want here (though if a command with the required API could be installed under a number of different names, perhaps then it would make sense to make it configurable or at least easy to change).
Solution 2:
Use -R
to recurse every level directories:
chmod +x -R /mnt/sdc1/user/6363/ARTERIAL/
Post a Comment for "Permission Denied Error With Subprocess.call()"