Tuesday, November 8, 2022

[FIXED] How to make Python inquirer working in Pycharm?

Issue

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


Solution

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

Then you can use also pycharm debug features

Preview



Answered By - romanemul
Answer Checked By - Mildred Charles (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.