I am using Python's raw_input to get input from keyboard.
How do I debug my code with PyCharm? I am unable to input from keyboard when (for example) name = raw_input("Input your name") is executed.
I am using Python's raw_input to get input from keyboard.
How do I debug my code with PyCharm? I am unable to input from keyboard when (for example) name = raw_input("Input your name") is executed.
You enter the input into the console that shows up, when you compile and run your script. Like so, the green text is the input.
PyCharm->Properties->Build->Console>"Always show debug console" which was checked, so Python console was taking my input. I de-selected the console checkbox, and now I can do what you suggest on the screenshot. Thanks.key = msvcrt.getch() doesn't work in PyCharm, but that seems to be known problem: stackoverflow.com/questions/30534218/….getpass.getpass(), I can only get it working in debug mode: see stackoverflow.com/questions/28579468/…The workaround I found (at least for input(), but I guess it's the same problem) is to check Emulate terminal in output console in your run config. Open up your run configuration | Modify options dropdown | Emulate terminal in output console.
Always show Debug Console seems to have no effect on that problem for me.
You can also track and up-vote the issue here: https://youtrack.jetbrains.com/issue/PY-42002/Not-able-to-use-input-while-debugging-with-remote-interpreter