Hi
I use MinGW64 bash, and I found the python2 has a little bug. If I write a simple py file:
# -*- coding: utf-8 -*- world = str(raw_input("hello:")) print world
and I use python2 example.py to run it, the result is
it will not display 'hello' first and if i input 'world' and press enter, the 'hello' will display.
but if I use python2 for windows 2.7.10, use cmd to run it, the result is
Hi,
Interactive native programs (all those in
/mingw64/bin
for example as well as any other program not compiled againstmsys2-runtime
, so every programs outside/usr/bin
) has difficulties to correclty work insidemintty
. This is becausemintty
is an emulator of a console and interfactive program sees it as a file based instead of an interactive console.I guess your problem is related to this fact. Try using
winpty python2 new.py
insidemintty
. I guess it will solve your problem. If it does, search in the tickets and forums aboutmintty
,interactive
,python
, you will find lot's more details whywinpty
is required and howmintty
actually works that make it kinda "fail".If it does not solve it, I will try to replicate to check if I see the same behavior. But seeing that it works in
cmd
makes a strong assement that interactivity is the problem.If
winpty
is unrecognized program, simply install it viapacman
.Regards,
Matt
Thanks~ Problem solved!
If I use winpty python2 new.py, everything is fine. It's weird, because python3 has no problem.
Anyway, thank you very much!
Okay, closing.