bchao1 / bullet

🚅 Interactive prompts made simple. Build a prompt like stacking blocks.
https://pypi.org/project/bullet/
MIT License
3.55k stars 113 forks source link

Having a problem with the very first docs example in python 3.7 #3

Closed garyrob closed 5 years ago

garyrob commented 5 years ago

The following is my terminal session trying to run the very first 3-line example on the documentation page, starting with "from bullet import Bullet, Check, YesNo, Input"

>>> from bullet import Bullet, Check, YesNo, Input
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'YesNo' from 'bullet' (/Users/garyrob/anaconda3/envs/py37/lib/python3.7/site-packages/bullet/__init__.py)
>>> from bullet import Bullet, Check, Input
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Input' from 'bullet' (/Users/garyrob/anaconda3/envs/py37/lib/python3.7/site-packages/bullet/__init__.py)
>>> from bullet import Bullet, Check
>>> cli = Bullet(prompt = "...")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'prompt'
>>> 
bchao1 commented 5 years ago

I just uploaded the newest package (1.2.1) to PyPI. Things should work well now, please check!

garyrob commented 5 years ago

>>> cli = Bullet(prompt = "...") # Setup styles Traceback (most recent call last): File "<stdin>", line 1, in <module> File ",,,/client.py", line 111, in __init__ raise ValueError("Choices can not be empty!") ValueError: Choices can not be empty!

I can fix it by populating the choices arg, but it seems like the example should work as-is. Otherwise, this looks like a useful project, thanks!