I am trying to execute a curl command within a python script.
If I do it in the terminal, it looks like this:
curl -X POST -d \'{\"nw_src\": \"10.0.
Rephrasing one of the answers in this post, instead of using cmd.split(). Try to use:
import shlex args = shlex.split(cmd)
Then feed args to subprocess.Popen.
Check this doc for more info: https://docs.python.org/2/library/subprocess.html#popen-constructor