I look for a package to make some simple console "form"

Jean-Michel Pichavant jeanmichel at sequans.com
Mon Apr 2 10:52:16 EDT 2012


Stéphane Klein wrote:
> Le 02/04/2012 15:54, Jean-Michel Pichavant a écrit :
>> Stéphane Klein wrote:
>>> Hi,
>>>
>>> I look for a package to make some console "form".
>>>
>>> It's a standard stuff, I think there are a package to do that.
>>>
>>> Example :
>>>
>>> What is your name ?
>>> Select your lang [EN, FR, DE…] ?
>>> Do you want … [Y, N] ?
>>>
>>> Type of field :
>>>
>>> * textline
>>> * select choice
>>> * boolean question
>>>
>>> Thank for your help,
>>> Stéphane
>> Hi,
>>
>> Have a look at
>> http://excess.org/urwid/
>>
>
> No, I don't look for high level feature based on ncurse…
>
> I would like very low level feature, form like sphinx quick start or 
> modern-package-template…
>
> Regards,
> Stephane
>
Don't know if there is such package. There's nothing that rawinput 
cannot handle in what you're asking for.
Anyway since you refered to sphinx, it does not use any package, look at 
quickstar.py, you may reuse their do_prompt.

And because being lazy is cool :

from sphinx import quickstart
d = {}
quickstart.do_prompt(d, 'foo', 'enter the foo value', '5', lambda x: int(x))
print d
< {'foo': 8}


JM



More information about the Python-list mailing list