I want to redirect the stdout to a file. But This will affect the raw_input. I need to redirect the output of raw_input to stde
stdout
raw_input
stde
Use getpass
import getpass value=getpass.getpass("Enter Name: ") print(value)
This will print the content value to stdout and Enter Name: to stderr.
value
Enter Name:
Tested and works with python 2.7 and 3.6.