a similar question has been asked before, but the answers suggested a workaround which is not applicable to my situation.
An email message is piped from mutt to a sc
Have you tried this:
message = sys.stdin.read() sys.stdin = open('/dev/tty') selected_index = raw_input('Which URL to open?')
This works on Linux; maybe it will work for OSX too.
Try to reset STDIN using sys.stdin.seek(0)
sys.stdin.seek(0)
Reference: http://docs.python.org/library/fileinput.html