pick icon indicating copy to clipboard operation
pick copied to clipboard

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

Open Pertii opened this issue 3 years ago • 2 comments

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)

Pertii avatar Mar 08 '22 20:03 Pertii

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

wong2 avatar Jul 14 '22 06:07 wong2

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.

InvisibleWaves avatar Aug 31 '22 15:08 InvisibleWaves

@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 avatar Oct 10 '22 03:10 wong2

Close as IDE terminals are not supported.

wong2 avatar Nov 06 '22 07:11 wong2