The sudo is the likely culprit and is probably asking for a password.
Instead of os.system, try using the subprocess module instead. That will let you see the stdout and stderr streams to see what is going on.
Also, I would question the practice of using sudo inside your script. Normally, the decision to use sudo would be left to the person calling the Python script.