In order to send a new frequency reference from python to the STM32F4 you have first to type enter and then "d 50" or the desired value.
The function sys.stdin.readline() detects when the first enter is typed while the raw_input() blocks any other process until the
new frequency is typed.