in a recent project i needed to redirect stdout and stderr. the way i did it was to use os.open() to open a new POSIX file descriptor then use a couple calls to os.dup2() to change descriptors 1 and 2. i just made sure i did stdout,flush() ahead of this. maybe you can do this for stdin (0). be sure you have empty buffers to avoid mixed data.
stdout.flush() fd = os.open(ln,os.O_APPEND|os.O_CREAT|os.O_WRONLY) os.dup2(fd,1) if fd != 1 else None os.dup2(1,2)"ln" means "log name". this is opening log files for several cloud programs.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.