Do you mean you want to extract the value from a message in node-red using a Python script to extract it? If so then that doesn't make any sense.
If you mean you want to extract the value in node red (which is described in the link I posted) and pass it to a python script then that is a different question. You can call a Python script using an Exec node and pass it whatever you like.
However, if that is what you mean, what are you doing in the script that cannot be done in node-red?