Having your root password in a script file is just plain stupid. Don't do it, there are better alternatives. This page describes how to make a shell script with the setuid bit set, and how to circumvent the restriction most modern Linux distributions have on setuid on shell scripts.
I'll summarize the salient parts here to comply with stackoverflow guidelines. First make a .c file (let's say it's called runscript.c) with this contents:
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
setuid( 0 );
system( "/path/to/script.sh" );
return 0;
}
Install gcc (apt-get install gcc on debian based distro's), then type
gcc -o runscript runscript.c
Now, as root, type
chown root:root runscript script.sh
chmod 4755 runscript script.sh
Now any user should be able to run runscript, and it will execute script.sh as if the user was root.
As long as both files are owned by root and not writeable by anyone else than root, this is fairly secure, and much more secure than embedding the root password in plaintext in a script file.
I've not succeeded in making this work for a script.py file for some reason, so if you really want to run a python script, have the script.sh file run it indirectly. If you do this, remember to set owner and permissions for the python script as well, using chown and chmod as above.
sudocommand will give you root privileges, and needs your password to do so. It's a really, really bad idea to give root access without a password.