I'm trying to create a python shell script to create a number of directories in Ubuntu Linux. The main directory I'm trying to create directories in is protected from write access. Is there a way to allow the Python script to be allowed to create directories in there as if it's the root user but not have to run the script through su, since other users might need to run the script but should not have su access?
You could create a separate command that creates the directory and make it setuid root (or, more safely, setuid or setgid to the owner of the parent directory).  Make sure the command can't do anything other than what you want to allow it to do (e.g., don't let it pass its argument to system()).  Then invoke that command from your Python script.
Of course this will also enable any other process with execute permission on the new command to create subdirectories.
How do you allow a Python script access to mkdir in a protected directory without su access in Linux?