aisk / pick

create curses based interactive selection list in the terminal
MIT License
729 stars 63 forks source link

kernel restart when "option, index = pick(options, title)" #64

Closed Pertii closed 1 year ago

Pertii commented 2 years ago

I'm new to Python, i don't know why this code "option, index = pick(options, title)" make my kernel reboot. I've installed pick by "pip install pick" and i imported it correctly with "from pick import pick". I'm working on anaconda on win11.

This is the full code

from pick import pick

title = 'Please choose filter: '
options = ['trending', 'hot', 'created', 'promoted']
option, index = pick(options, title)
wong2 commented 2 years ago

I have no idea because I don't have a windows computer. Can you still reproduce this?

InvisibleWaves commented 2 years ago

Hi @wong2, I suspect I'm running into the same problem.

Minimum working example:

from pick import pick

testpick = ['test1', 'test2', 'test3']
a,b = pick(testpick, 'Test Pick')

This produces the error when the pick() function is called:

LINES value must be >= 2 and <= 132: got -38521
initscr(): Unable to create SP

I'm running Python 3.7 (32-bit) on Windows 10 and using Visual Studio 2019 as an IDE.

If I re-run the MWE above, the "got" number is different every time.

wong2 commented 2 years ago

@InvisibleWaves according to a comment from https://stackoverflow.com/questions/70084286/lines-value-must-be-2-and-168-got-1-initscr-unable-to-create-sp

curses is generally not going to work from within an IDE - try running it directly from a terminal window.

wong2 commented 1 year ago

Close as IDE terminals are not supported.