Skip to content
Advertisement

How to make Python inquirer working in Pycharm?

Hello, I’m trying to make an interactive menu in python console. I found python-inquirer should be good for my purpose, but it doesn’t work in PyCharm when I run it, it just prints out the options and I can’t choose anything. Does anyone know what my problem is and how to solve it? I’m really happy for any help.

from pprint import pprint
import inquirer

questions = [
    inquirer.List(
        "size",
        message="What size do you need?",
        choices=["Jumbo", "Large", "Standard", "Medium", "Small", "Micro"],
    ),
]

answers = inquirer.prompt(questions)
pprint(answers)

The code is just copy-pasted from python inquirer documentation There are no errors when I run it, it just doesn’t work

Advertisement

Answer

In Run/Debug Configuration of your Pycharm project tick “Emulate terminal in output console”

Then you can use also pycharm debug features

Preview

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement