aisk / pick

create curses based interactive selection list in the terminal
MIT License
722 stars 61 forks source link

Trouble running it on MacOS using PyCharm #49

Closed thevickypedia closed 3 years ago

thevickypedia commented 3 years ago

I tried running it on MacOS using PyCharm, tried to replicate your example:

from pick import pick
title = 'Please choose your favorite programming language: '
options = ['Java', 'JavaScript', 'Python', 'PHP', 'C++', 'Erlang', 'Haskell']
option, index = pick(options, title, indicator='=>', default_index=2)
print(option, index)

I keep getting the _curses.error: nocbreak() returned ERR exception. I tried the solution here still no luck. Is there any chance I can have this working on PyCharm output console instead of a Terminal?

emeryjune commented 3 years ago

@thevickypedia The error is because it doesn't identify the Pycharm console as an actual terminal. You can fix this by going to Edit Configuration (top right corner, left from the Play/Run button). Then check Execution => Emulate terminal in output console

thevickypedia commented 3 years ago

works like a charm, thank you @emeryjune :) Screen Shot 2021-02-15 at 12 23 25 PM