CITGuru / PyInquirer

A Python module for common interactive command line user interfaces
MIT License
1.94k stars 236 forks source link

How to remove (hide) the result of prompt #36

Open supersuraccoon opened 5 years ago

supersuraccoon commented 5 years ago

Thanks for the great project now I am using it to create something cool ...

And now I am facing a problem that I can not seem to find a way to solve.

Say I have the following script:

print("begin to call inquire.list ===========>\n")  
questions = [
    {
        'type': 'list',
        'name': "name",
        'message': "message",
        'choices': ["choices1", "choices2", "choices3"]
    }
]
result = PyInquirer.prompt(questions)
print("\nresult:")  
print(result)
print("\nend to call inquire.list") 

And the final output in the terminal is

➜   python3 main.py
begin to call inquire.list ===========>

? message  choices2

result:
{'name': 'choices2'}

end to call inquire.list

Now what I want to achieve is after make the selection, the line of output

? message  choices2

is removed or hide (I do not what this to be shown in the terminal)

Just like during the list selection the output is

➜  python3 main.py
begin to call inquire.list ===========>

? message  (Use arrow keys)
 ❯ choices1
   choices2
   choices3

And after I made the choice these choices are removed from the terminal output.

I do not know if this is possible to achieve, any advice will be appreciated, thanks :)