Let me see if I read this right. May be just style differences, but...
When I'm trying to work out (debug) a bash or python script... I'll put in debug code (echo or print statements) to see if my code is reacting like I'm expecting it too and to show me what is going on underneath. I can always comment it out or remove it when I get it going. What it showed me is that your variable were not loading... ad your expect commandline string varaible was trying to execute on the string init.
# Debug expect & screen script.
# You have to add quotes around a string to init your variable.
# Debugged it by adding the next ine and seeing what it was initialized to...
# This was trying to execute the command instead of loading a variable with your
# variable = string = commandline... showed executing with errors, but blank as
# a variable...
# expexec=$(/usr/bin/expect -c "/usr/bin/python /opt/app.py expect \"Interaction:\" send \"$sent\r\" interact")
# This is what I came up with:
expexec="/usr/bin/expect -c \"/usr/bin/python /opt/app.py expect \"Interaction:\" send \"$sent\r\" interact\""
# This was the debug line to see what it loaded as:
/usr/bin/screen -L -dmS spawner /bin/sleep 30
/usr/bin/screen -S spawner -X screen screen -L -dR myDaemon
/usr/bin/screen -S myDaemon -X detach
## Can the Op explain this one? Is he tring to "echo" it or execute it? I'm thinking he needs to take the echo out of that next line...
/usr/bin/screen -S myDaemon -X stuff "echo $expexec"
/usr/bin/screen -S spawner -X stuff "exit\r"
Try the changes and see if that works. ...At least that part of it is working now. Didn't really look at the screen lines... I know some say bash and expect play weird together sometimes, so some, if using bash, call to an expect script... then return.
Look in my comments. I have questions
The application is a python app? Why not a python script (sys:exec) talking with each other? Just a thought.