Consider the following sample script:
import os
import sys
print(1)
os.execl(sys.executable, sys.executable, '-c', 'print(2)')
print(3)
The result is
1
I was expecting
1
2
I think it is because the replacing process is not using the same stdin/stdout/stderr?
How can I achieve what I was expecting for while using execl
?
I'm using Python 3.6 on Windows.